HttpClient

Trait HttpClient 

Source
pub trait HttpClient:
    'static
    + Send
    + Sync {
    // Required methods
    fn type_name(&self) -> &'static str;
    fn user_agent(&self) -> Option<&HeaderValue>;
    fn send(
        &self,
        req: Request<AsyncBody>,
    ) -> BoxFuture<'static, Result<Response<AsyncBody>>>;
    fn proxy(&self) -> Option<&Url>;

    // Provided methods
    fn get(
        &self,
        uri: &str,
        body: AsyncBody,
        follow_redirects: bool,
    ) -> BoxFuture<'static, Result<Response<AsyncBody>>> { ... }
    fn post_json(
        &self,
        uri: &str,
        body: AsyncBody,
    ) -> BoxFuture<'static, Result<Response<AsyncBody>>> { ... }
    fn send_multipart_form<'a>(
        &'a self,
        _url: &str,
        _request: Form,
    ) -> BoxFuture<'a, Result<Response<AsyncBody>>> { ... }
}

Required Methods§

Source

fn type_name(&self) -> &'static str

Source

fn user_agent(&self) -> Option<&HeaderValue>

Source

fn send( &self, req: Request<AsyncBody>, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>

Source

fn proxy(&self) -> Option<&Url>

Provided Methods§

Source

fn get( &self, uri: &str, body: AsyncBody, follow_redirects: bool, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>

Source

fn post_json( &self, uri: &str, body: AsyncBody, ) -> BoxFuture<'static, Result<Response<AsyncBody>>>

Source

fn send_multipart_form<'a>( &'a self, _url: &str, _request: Form, ) -> BoxFuture<'a, Result<Response<AsyncBody>>>

Implementors§