pub struct Uploaded { /* private fields */ }Expand description
The answer to an upload: the status, the headers, and the response body.
Each final status arrives here, also an unsuccessful one. The caller decides what it means.
The Debug output shows the name of each response header, and
<redacted> in place of its value. A header with several values shows its
name once for each value. The URL shows with no userinfo. A query shows as
?<redacted>, and a fragment shows as #<redacted>.
Implementations§
Source§impl Uploaded
impl Uploaded
Sourcepub fn url(&self) -> &str
pub fn url(&self) -> &str
Returns the URL that answered.
After a redirect, this is the URL of the last hop.
Sourcepub fn body_withheld(&self) -> bool
pub fn body_withheld(&self) -> bool
Returns true if the upload withheld the body of the response.
An answer other than 2xx whose head declares a coding, or a
Content-Length over max_response,
comes with its status and its headers alone. Its body is not read:
into_body gives a body that reads as empty,
and the connection closes. Fetcher::upload states the rule.
Sourcepub fn into_body(self) -> Body
pub fn into_body(self) -> Body
Returns the response body, capped at
max_response.
The body holds the admission permit until it ends or is dropped. A withheld body reads as empty and holds no permit.