[−][src]Struct chttp::client::Client
An HTTP client for making requests.
The client maintains a connection pool internally and is expensive to create, so we recommend re-using your clients instead of discarding and recreating them.
Methods
impl Client[src]
impl Clientpub fn new() -> Result<Self, Error> | [src] |
Create a new HTTP client using the default configuration.
If the client fails to initialize, an error will be returned.
pub fn builder() -> ClientBuilder | [src] |
Create a new builder for building a custom client.
pub fn get<U>(&self, uri: U) -> Result<Response<Body>, Error> where | [src] |
Sends an HTTP GET request.
The response body is provided as a stream that may only be consumed once.
pub fn head<U>(&self, uri: U) -> Result<Response<Body>, Error> where | [src] |
Sends an HTTP HEAD request.
pub fn post<U>( | [src] |
Sends an HTTP POST request.
The response body is provided as a stream that may only be consumed once.
pub fn put<U>( | [src] |
Sends an HTTP PUT request.
The response body is provided as a stream that may only be consumed once.
pub fn delete<U>(&self, uri: U) -> Result<Response<Body>, Error> where | [src] |
Sends an HTTP DELETE request.
The response body is provided as a stream that may only be consumed once.
pub fn send<B: Into<Body>>( | [src] |
Sends a request and returns the response.
The request may include extensions to customize how it is sent. If the
request contains an Options struct as an extension, then those options will be used
instead of the default options this client is configured with.
The response body is provided as a stream that may only be consumed once.
pub fn send_async<B: Into<Body>>( | [src] |
Begin sending a request and return a future of the response.
The request may include extensions to customize how it is sent. If the
request contains an Options struct as an extension, then those options will be used
instead of the default options this client is configured with.
The response body is provided as a stream that may only be consumed once.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId | [src] |
impl<T> Erased for T
impl<T> Erased for T