HttpClient

Trait HttpClient 

Source
pub trait HttpClient:
    Send
    + Sync
    + Any {
    // Required method
    fn send(
        &'static self,
        request: Request,
    ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send>>;

    // Provided method
    fn is_cache_manager(&self) -> bool { ... }
}
Expand description

HTTP client backend.

See http_client for more details.

Required Methods§

Source

fn send( &'static self, request: Request, ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send>>

Send a request and await until response header is received. Full response body can continue to be received using the Response value.

Provided Methods§

Source

fn is_cache_manager(&self) -> bool

If the client manages cache and cookie storage.

Is false by default. When false the http_cache is used before and after send.

Implementors§