Struct async_http_client::HttpResponse
[−]
[src]
pub struct HttpResponse { /* fields omitted */ }
Representation of an HTTP response.
Methods
impl HttpResponse
[src]
fn status(&self) -> u32
Returns the status code of this response.
fn is<K: AsRef<str>, V: AsRef<str>>(&self, name: K, expected: V) -> bool
Returns true if this response has a header with the given name
that matches the expected value
.
Comparisons are made in a case-insensitive manner.
fn has<K: AsRef<str>, V: AsRef<str>>(&self, name: K, expected: V) -> bool
Returns true if this response has a header with the given name
that has a comma-separated list of values, and one of those values
matches the expected
value.
Comparisons are made in a case-insensitive manner. Each value of the comma-separated list is trimmed before comparison.
fn is_informational(&self) -> bool
Returns true if this response has a 1xx Informational status code.
fn is_successful(&self) -> bool
Returns true if this response has a 2xx Successful status code.
fn is_redirection(&self) -> bool
Returns true if this response has a 3xx Redirection status code.
fn is_client_error(&self) -> bool
Returns true if this response has a 4xx Client Error status code.
fn is_server_error(&self) -> bool
Returns true if this response isisis a 5xx Server Error status code.
Trait Implementations
impl PartialEq for HttpResponse
[src]
fn eq(&self, __arg_0: &HttpResponse) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HttpResponse) -> bool
This method tests for !=
.
impl Eq for HttpResponse
[src]
impl Debug for HttpResponse
[src]
impl<'a> Index<&'a str> for HttpResponse
[src]
type Output = Option<String>
The returned type after indexing
fn index(&self, name: &str) -> &Option<String>
Retrieve the header with the given name.
Comparison is made in a case-insensitive manner.