Struct hyper::client::Client [] [src]

pub struct Client {
    // some fields omitted
}

A Client to use additional features with Requests.

Clients can handle things such as: redirect policy, connection pooling.

Methods

impl Client
[src]

fn new() -> Client

Create a new Client.

fn with_pool_config(config: Config) -> Client

Create a new Client with a configured Pool Config.

fn with_http_proxy<H>(host: H, port: u16) -> Client where H: Into<Cow<'static, str>>

fn with_proxy_config<H, S>(proxy_config: ProxyConfig<H, S>) -> Client where H: Into<Cow<'static, str>>, S: SslClient<HttpConnector::Stream> + Send + Sync + 'static

fn with_connector<C, S>(connector: C) -> Client where C: NetworkConnector<Stream=S> + Send + Sync + 'static, S: NetworkStream + Send

Create a new client with a specific connector.

fn with_protocol<P: Protocol + Send + Sync + 'static>(protocol: P) -> Client

Create a new client with a specific Protocol.

fn set_redirect_policy(&mut self, policy: RedirectPolicy)

Set the RedirectPolicy.

fn set_read_timeout(&mut self, dur: Option<Duration>)

Set the read timeout value for all requests.

fn set_write_timeout(&mut self, dur: Option<Duration>)

Set the write timeout value for all requests.

fn get<U: IntoUrl>(&self, url: U) -> RequestBuilder

Build a Get request.

fn head<U: IntoUrl>(&self, url: U) -> RequestBuilder

Build a Head request.

fn patch<U: IntoUrl>(&self, url: U) -> RequestBuilder

Build a Patch request.

fn post<U: IntoUrl>(&self, url: U) -> RequestBuilder

Build a Post request.

fn put<U: IntoUrl>(&self, url: U) -> RequestBuilder

Build a Put request.

fn delete<U: IntoUrl>(&self, url: U) -> RequestBuilder

Build a Delete request.

fn request<U: IntoUrl>(&self, method: Method, url: U) -> RequestBuilder

Build a new request using this Client.

Trait Implementations

impl Debug for Client
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Default for Client
[src]

fn default() -> Client

Returns the "default value" for a type. Read more