Expand description
“Raw” HTTP client APIs.
The conjure_runtime::Client wraps a raw HTTP client, which is used to handle the actual HTTP communication. A
default raw client is provided, but this can be overridden if desired.
§Behavior
The raw client interacts directly with the http::Request and http::Response types, with a body type
implementing the http_body::Body trait rather than using the AsyncBody type. The request’s URI is provided in
absolute-form, and all headers have already been set in the header map. The HTTP response should be
returned directly, without any interpretation of the status code, handling of redirects, etc.
A raw client is expected to implement Service<Request<RawBody>, Response = Response<B>>, where B implements the
http_body::Body trait. The error type returned by the client must implement Into<Box<dyn Error + Sync + Send>>
and be safe-loggable.
Some configuration set in the Builder affects the raw client, including the connect timeout, security
configuration, and proxy configuration. The default raw client respects these settings, but other implementations
will need to handle them on their own.
Structs§
- Body
Error - The error type returned by
RawBody. - Default
RawBody - The body type used by
DefaultRawClient. - Default
RawClient - The default raw client implementation used by
conjure_runtime. - Default
RawClient Builder - The default raw client builder used by
conjure_runtime. - Default
RawError - The error type used by
DefaultRawClient. - RawBody
- The request body type passed to the raw HTTP client.
Traits§
- Build
RawClient - A factory of raw HTTP clients.
- Service
- An asynchronous function from request to response.