HttpClient

Trait HttpClient 

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

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

Required Methods§

Source

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

Source

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

Source

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

Provided Methods§

Source

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

Source

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

Implementations on Foreign Types§

Source§

impl HttpClient for Arc<HttpClientWithProxy>

Source§

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

Source§

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

Source§

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

Source§

impl HttpClient for Arc<HttpClientWithUrl>

Source§

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

Source§

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

Source§

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

Implementors§