Skip to main content

http_client

Function http_client 

Source
pub fn http_client() -> Client
Expand description

Returns a clone of the shared reqwest::Client.

The client is built once at first use and reused for all subsequent calls. reqwest::Client is cheap to clone (it wraps an Arc internally), so cloning enables connection pooling, DNS caching, and TLS session reuse.

For authenticated requests, use http_client and add the cookie per-request via .header(COOKIE, ...).