[−][src]Trait conjure_http::client::AsyncClient
A trait implemented by async HTTP client implementations.
Associated Types
type BinaryWriter
The client's binary request body writer type.
type BinaryBody
The client's binary response body type.
Required methods
ⓘImportant traits for Pin<P>fn request<'a, T, U>(
&'a self,
method: Method,
path: &'static str,
path_params: PathParams,
query_params: QueryParams,
headers: HeaderMap,
body: T,
response_visitor: U
) -> Pin<Box<dyn Future<Output = Result<U::Output, Error>> + Send + 'a>> where
T: AsyncRequestBody<'a, Self::BinaryWriter> + Send + 'a,
U: VisitResponse<Self::BinaryBody> + Send + 'a,
ⓘImportant traits for Pin<P>
&'a self,
method: Method,
path: &'static str,
path_params: PathParams,
query_params: QueryParams,
headers: HeaderMap,
body: T,
response_visitor: U
) -> Pin<Box<dyn Future<Output = Result<U::Output, Error>> + Send + 'a>> where
T: AsyncRequestBody<'a, Self::BinaryWriter> + Send + 'a,
U: VisitResponse<Self::BinaryBody> + Send + 'a,
Makes an async 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.