Skip to main content

Module http

Module http 

Source

Enums§

HttpClientError
Errors that can occur when building or using an HTTP client.

Constants§

MAX_RESPONSE_BYTES
Maximum body size accepted from any upstream HTTP response. Anything larger is rejected with HttpClientError::BodyTooLarge to prevent allocator DoS from a compromised upstream or malicious CDN edge.

Functions§

bearer_client
HTTP client with a Bearer token for authenticated APIs.
bytes_with_limit
Read a response body into a Vec<u8>, aborting as soon as the byte count exceeds limit. Prevents a hostile or buggy upstream from OOM-killing the process by streaming an unbounded body.
default_client
Default HTTP client with timeouts, user-agent, strict redirect policy, and HTTPS-only enforcement.
private_token_client
HTTP client with a Private-Token header (GitLab).