pub struct Response { /* private fields */ }
Expand description

A Response to a submitted Request.

Implementations

Get the StatusCode of this Response.

Get the Headers of this Response.

Get a mutable reference to the Headers of this Response.

Get the content-length of this response, if known.

Reasons it may not be known:

  • The server didn’t send a content-length header.
  • The response is compressed and automatically decoded (thus changing the actual decoded length).

Get the final Url of this Response.

Available on crate feature json only.

Try to deserialize the response body as JSON.

Get the response text.

Get the response as bytes

Turn a response into an error if the server returned an error.

Turn a reference to a response into an error if the server returned an error.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.