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§
- Http
Timeouts - Resolved HTTP timeout defaults shared by every outbound client.
Functions§
- apply_
connect_ timeout - Apply the installed connect budget to an explicit client builder.
- 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.