Trait HttpResponse

Source
pub trait HttpResponse: Read + Debug
where Self: Sized,
{ // Required methods fn headers(&self) -> &HeaderMap; fn status(&self) -> StatusCode; fn error_for_status(self) -> Result<Self, Box<dyn Error>>; }
Expand description

Represents the result of sending an HTTP request.

Modelled after reqwest::Response.

Required Methods§

Source

fn headers(&self) -> &HeaderMap

Obtain access to the headers of the response.

Source

fn status(&self) -> StatusCode

Obtain a copy of the response’s status.

Source

fn error_for_status(self) -> Result<Self, Box<dyn Error>>

Return an error if the response’s status is in the range 400-599.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HttpResponse for Response

Implementors§