Skip to main content

Module http

Module http 

Source
Expand description

HTTP client utilities

Timeouts here are defaults, not laws. A 5-second connect timeout is fine for a warm cache next to the registry and wrong for a first-ever TLS handshake over a slow link; a 30-second request timeout is generous for a metadata fetch and fatal for a cold-start local model. Callers that know better can pass explicit values, and users can override the defaults through [timeouts] http_connect_seconds / http_request_seconds / http_download_seconds (or the VTCODE_HTTP_*_TIMEOUT_SECS env vars), which reach this module via install_http_timeouts.

Structs§

HttpTimeouts
Resolved HTTP timeout defaults shared by every outbound client.

Functions§

create_client_with_timeout
Create an HTTP client with a custom request timeout.
create_client_with_timeouts
Create an HTTP client with custom connect and request timeouts.
create_client_with_user_agent
Create an HTTP client with a specific user agent.
create_client_without_redirects
Build an origin-bound client without a fallback that could enable redirects.
create_default_client
Create a default HTTP client with the installed timeout defaults.
create_default_client_without_redirects
Build an origin-bound client without redirects, using the installed defaults.
create_download_client
Create a client for large artifact transfers (release downloads, assets).
create_streaming_client
Create an HTTP client optimized for streaming.
get_or_create_default_client
Get a default client or create one
http_timeouts
Current process-wide HTTP timeout defaults.
install_http_timeouts
Install process-wide HTTP timeout defaults.