pub trait Client {
    type BodyWriter;
    type ResponseBody: Iterator<Item = Result<Bytes, Error>>;

    fn send(
        &self,
        req: Request<Body<'_, Self::BodyWriter>>
    ) -> Result<Response<Self::ResponseBody>, Error>; }
Expand description

A trait implemented by HTTP client implementations.

Required Associated Types§

The client’s binary request write type.

The client’s binary response body type.

Required Methods§

Makes an HTTP request.

The request’s URI will be in absolute-form and it will always contain an Endpoint object in its extensions.

A response must only be returned if it has a 2xx status code. The client is responsible for handling all other status codes (for example, converting a 5xx response into a service error). The client is also responsible for decoding the response body if necessary.

Implementors§