pub struct Response { /* fields omitted */ }
A Response to a submitted Request
.
Get the final Url
of this Response
.
Get the remote address used to get this Response
.
Get the StatusCode
of this Response
.
Get the Headers
of this Response
.
Get a mutable reference to the Headers
of this Response
.
Consumes the response, returning the body
pub fn body(&self) -> &Decoder | [src] |
Get a reference to the response body.
pub fn body_mut(&mut self) -> &mut Decoder | [src] |
Get a mutable reference to the response body.
The chunks from the body may be decoded, depending on the gzip
option on the ClientBuilder
.
Get the HTTP Version
of this Response
.
Try to deserialize the response body as JSON using serde
.
Turn a response into an error if the server returned an error.
fn on_response(res: Response) {
match res.error_for_status() {
Ok(_res) => (),
Err(err) => {
assert_eq!(
err.status(),
Some(reqwest::StatusCode::BAD_REQUEST)
);
}
}
}
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static