Skip to main content

Module http_client

Module http_client 

Source
Expand description

Crate-wide outbound HTTP agent constructors.

Every outbound call must carry a hard deadline: a stalled remote must FAIL, never hang the wizard. Bare ureq::get/post(...) calls have no default timeout in ureq 3 — do not add new ones; construct an agent here instead so the deadline policy stays in one place.

Constants§

API_TIMEOUT
Hard deadline for interactive API calls (OAuth token/device-code exchanges, Microsoft Graph, provider setup steps). Generous enough for slow provider backends; small enough that a wedged connection surfaces as an error while the operator is still watching.
DOWNLOAD_TIMEOUT
Hard deadline for potentially large downloads (bundle archives, tunnel binaries). Caps the entire transfer, not just connect.

Functions§

api_agent
Agent for API calls with ureq’s default status handling (non-2xx becomes Err(ureq::Error::StatusCode(..))) — drop-in for bare ureq:: calls.
api_agent_any_status
Agent for API calls where non-2xx statuses are handled as regular responses (http_status_as_error(false)) — drop-in for call sites that inspect status codes themselves (OAuth polling, Graph error bodies).
download_agent
Agent for downloads: same failure semantics, longer transfer budget.