Trait isahc::ResponseExt[][src]

pub trait ResponseExt<T> {
    fn effective_uri(&self) -> Option<&Uri>;
fn local_addr(&self) -> Option<SocketAddr>;
fn remote_addr(&self) -> Option<SocketAddr>;
fn cookie_jar(&self) -> Option<&CookieJar>;
fn metrics(&self) -> Option<&Metrics>; }

Provides extension methods for working with HTTP responses.

Required methods

fn effective_uri(&self) -> Option<&Uri>[src]

Get the effective URI of this response. This value differs from the original URI provided when making the request if at least one redirect was followed.

This information is only available if populated by the HTTP client that produced the response.

fn local_addr(&self) -> Option<SocketAddr>[src]

Get the local socket address of the last-used connection involved in this request, if known.

Multiple connections may be involved in a request, such as with redirects.

This method only makes sense with a normal Internet request. If some other kind of transport is used to perform the request, such as a Unix socket, then this method will return None.

fn remote_addr(&self) -> Option<SocketAddr>[src]

Get the remote socket address of the last-used connection involved in this request, if known.

Multiple connections may be involved in a request, such as with redirects.

This method only makes sense with a normal Internet request. If some other kind of transport is used to perform the request, such as a Unix socket, then this method will return None.

Addresses and proxies

The address returned by this method is the IP address and port that the client connected to and not necessarily the real address of the origin server. Forward and reverse proxies between the caller and the server can cause the address to be returned to reflect the address of the nearest proxy rather than the server.

fn cookie_jar(&self) -> Option<&CookieJar>[src]

Get the configured cookie jar used for persisting cookies from this response, if any.

Availability

This method is only available when the cookies feature is enabled.

fn metrics(&self) -> Option<&Metrics>[src]

If request metrics are enabled for this particular transfer, return a metrics object containing a live view of currently available data.

By default metrics are disabled and None will be returned. To enable metrics you can use Configurable::metrics.

Loading content...

Implementors

Loading content...