Skip to main content

default_client

Function default_client 

Source
pub fn default_client() -> Client
Expand description

Builds a reqwest::Client with library defaults.

The client has a 300-second total timeout and a 60-second connect timeout. Pass your own client to any request method if you need a different configuration (proxy, timeout, pooling, …).

This function does not select a TLS backend: see the module docs for why, and install a provider (with install_crypto_provider under the ferritls feature, or one of your own) before the first client is built.

§Panics

Panics if no rustls crypto provider has been installed as the process default yet — reqwest’s rustls-no-provider build requires one at client construction time. This mirrors the panic behavior of reqwest::Client::new.