Struct hyper::client::Client [−][src]
pub struct Client<C, B = Body> { /* fields omitted */ }
A Client to make outgoing HTTP requests.
Methods
impl Client<HttpConnector, Body>
[src]
impl Client<HttpConnector, Body>
pub fn new() -> Client<HttpConnector, Body>
[src]
pub fn new() -> Client<HttpConnector, Body>
Create a new Client with the default config.
Note
The default connector does not handle TLS. Speaking to https
destinations will require configuring a connector that implements TLS.
impl Client<(), Body>
[src]
impl Client<(), Body>
pub fn builder() -> Builder
[src]
pub fn builder() -> Builder
Configure a Client.
Example
fn run () { use hyper::Client; let client = Client::builder() .keep_alive(true) .build_http();
impl<C, B> Client<C, B> where
C: Connect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
B: Payload + Send + 'static,
B::Data: Send,
[src]
impl<C, B> Client<C, B> where
C: Connect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
B: Payload + Send + 'static,
B::Data: Send,
pub fn get(&self, uri: Uri) -> ResponseFuture where
B: Default,
[src]
pub fn get(&self, uri: Uri) -> ResponseFuture where
B: Default,
Send a GET
request to the supplied Uri
.
Note
This requires that the Payload
type have a Default
implementation.
It should return an "empty" version of itself, such that
Payload::is_end_stream
is true
.
pub fn request(&self, req: Request<B>) -> ResponseFuture
[src]
pub fn request(&self, req: Request<B>) -> ResponseFuture
Send a constructed Request using this Client.
Trait Implementations
impl Default for Client<HttpConnector, Body>
[src]
impl Default for Client<HttpConnector, Body>
impl<C, B> Clone for Client<C, B>
[src]
impl<C, B> Clone for Client<C, B>
fn clone(&self) -> Client<C, B>
[src]
fn clone(&self) -> Client<C, B>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<C, B> Debug for Client<C, B>
[src]
impl<C, B> Debug for Client<C, B>