Trait conjure_http::client::AsyncClient
source · pub trait AsyncClient {
type BodyWriter;
type ResponseBody: Stream<Item = Result<Bytes, Error>>;
// Required method
fn send(
&self,
req: Request<AsyncRequestBody<'_, Self::BodyWriter>>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Error>> + Send;
}Expand description
A trait implemented by async HTTP client implementations.
Required Associated Types§
sourcetype BodyWriter
type BodyWriter
The client’s binary request body write type.
Required Methods§
sourcefn send(
&self,
req: Request<AsyncRequestBody<'_, Self::BodyWriter>>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Error>> + Send
fn send( &self, req: Request<AsyncRequestBody<'_, Self::BodyWriter>>, ) -> impl Future<Output = Result<Response<Self::ResponseBody>, Error>> + Send
Makes an HTTP request.
The client is responsible for assembling the request URI. It is provided with the path template, unencoded path parameters, unencoded query parameters, header parameters, and request body.
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.
Object Safety§
This trait is not object safe.