Skip to main content

http_builder

Function http_builder 

Source
pub fn http_builder() -> ClientBuilder
Expand description

The builder every SDK transport starts from: rustls only (the SDK’s reqwest has no default features and only rustls), the bundled webpki roots as the only trust anchors (trust_roots), and the protocol handshake as default headers.

One builder rather than one client because dial_client adds a connect timeout on top and the auth, sync and typed clients do not; what they share is the handshake, and this is the one place it is installed. A transport built any other way sends no handshake and is refused by every gated route, which is why nothing in this crate calls reqwest::Client::builder() directly outside tests.

Parallelism is connections, not streams (networking doc, HTTP Transport). Every transport is pinned to HTTP/1.1, so each request in flight at once rides its own pooled connection: a lane’s sessions in flight spread across several TCP windows instead of sharing the one an HTTP/2 connection would multiplex them onto, which is what keeps a lossy or high-latency link busy. The pin is explicit rather than left to the SDK’s reqwest features leaving http2 out, so a feature another crate enables can never fold the windows back onto one connection.