[−][src]Trait conjure_http::client::Client
A trait implemented by 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
fn request<'a, T, U>(
&self,
method: Method,
path: &'static str,
path_params: PathParams,
query_params: QueryParams,
headers: HeaderMap,
body: T,
response_visitor: U
) -> Result<U::Output, Error> where
T: RequestBody<'a, Self::BinaryWriter>,
U: VisitResponse<Self::BinaryBody>,
&self,
method: Method,
path: &'static str,
path_params: PathParams,
query_params: QueryParams,
headers: HeaderMap,
body: T,
response_visitor: U
) -> Result<U::Output, Error> where
T: RequestBody<'a, Self::BinaryWriter>,
U: VisitResponse<Self::BinaryBody>,
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.