Skip to main content

Module http

Module http 

Source

Constants§

CONNECT_TIMEOUT
How long establishing the connection may take, before anything is sent.
NON_STREAMING_REQUEST_TIMEOUT
Total deadline for a single request/response exchange, for callers that do not set their own. Never apply it to a streaming request: reqwest counts it until the response body has finished, so it would cut off a long but healthy stream.
STREAM_IDLE_TIMEOUT
How long a streaming response body may go without producing a chunk before it counts as stalled. Applied per chunk by the caller, unlike ClientBuilder::read_timeout; see REQWEST_STREAMING_CLIENT.
STREAM_RESPONSE_HEADERS_TIMEOUT
How long a streaming request may take to produce response headers. Applied by the caller with tokio::time::timeout around send(), which resolves on headers, so the body is left untimed.

Statics§

REQWEST_CLIENT
REQWEST_STREAMING_CLIENT
For responses whose body is consumed as a stream. Carries no total or read timeout, because both would cut off a healthy but slow stream; callers must instead bound the header wait with STREAM_RESPONSE_HEADERS_TIMEOUT and each chunk with STREAM_IDLE_TIMEOUT.

Functions§

base_client_builder
The settings every HTTP client shares: rustls, https only outside test mode, and the connect timeout. Other timeouts are left to the caller.
escape_auth_param
Escapes a value for a quoted-string auth-param of a WWW-Authenticate header (RFC 9110 §11.2).
in_http_test_mode 🔒