pub struct HttpClientBuilder { /* private fields */ }Expand description
Builder for HttpClient. Certificate and identity bytes are parsed at
build; failures do not wait for the first request.
Implementations§
Source§impl HttpClientBuilder
impl HttpClientBuilder
Sourcepub fn root_policy(self, policy: RootPolicy) -> Self
pub fn root_policy(self, policy: RootPolicy) -> Self
System store (default) or custom PEMs only.
Sourcepub fn add_root_certificate_pem(
self,
pem: impl AsRef<[u8]>,
) -> Result<Self, HttpInputError>
pub fn add_root_certificate_pem( self, pem: impl AsRef<[u8]>, ) -> Result<Self, HttpInputError>
Append a PEM certificate to the trust store. Parsed immediately.
Sourcepub fn client_identity_pem(self, pem: impl Into<Vec<u8>>) -> Self
pub fn client_identity_pem(self, pem: impl Into<Vec<u8>>) -> Self
PEM client identity (cert chain + unencrypted private key) for mTLS.
Sourcepub fn user_agent(self, ua: impl Into<String>) -> Self
pub fn user_agent(self, ua: impl Into<String>) -> Self
Override the default ez-ffmpeg/<version> User-Agent.
Sourcepub fn disable_user_agent(self) -> Self
pub fn disable_user_agent(self) -> Self
Send no User-Agent header.
Sourcepub fn proxy(self, policy: ProxyPolicy) -> Self
pub fn proxy(self, policy: ProxyPolicy) -> Self
Proxy policy. Default is environment variables snapshotted at build.
Sourcepub fn timeouts(self, timeouts: HttpTimeouts) -> Self
pub fn timeouts(self, timeouts: HttpTimeouts) -> Self
Default timeouts inherited by HttpClient::input unless the input
overrides them. response_headers and read_idle can be overridden
per input. connect is applied once to the reqwest client at
build and cannot be changed per input afterwards.
Sourcepub fn redirect_limit(self, limit: u32) -> Self
pub fn redirect_limit(self, limit: u32) -> Self
Maximum redirect hops (default 10). 0 follows no redirect: the
original request is sent once and a 3xx response is an error.
Sourcepub fn build(self) -> Result<HttpClient, HttpInputError>
pub fn build(self) -> Result<HttpClient, HttpInputError>
Build the reqwest client and load trust anchors. No network I/O.