pub struct ReqwestClient { /* private fields */ }reqwest only.Expand description
The HttpClient the SDK ships, over reqwest with rustls and HTTP/2. This is what a
client gets when nothing else is supplied.
It never follows a redirect, whatever it was built from: the SDK does that itself.
Implementations§
Source§impl ReqwestClient
impl ReqwestClient
Sourcepub fn with_timeout(timeout: Duration) -> Result<ReqwestClient, Error>
pub fn with_timeout(timeout: Duration) -> Result<ReqwestClient, Error>
A client that gives an answer timeout to arrive.
Sourcepub fn from_builder(builder: ClientBuilder) -> Result<ReqwestClient, Error>
pub fn from_builder(builder: ClientBuilder) -> Result<ReqwestClient, Error>
A client built from settings of the caller’s own — a proxy, a root certificate, a set of default headers. Whatever redirect policy the builder carries is replaced with none, since following one here would hide it from the SDK.
Trait Implementations§
Source§impl Clone for ReqwestClient
impl Clone for ReqwestClient
Source§fn clone(&self) -> ReqwestClient
fn clone(&self) -> ReqwestClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReqwestClient
impl Debug for ReqwestClient
Source§impl Default for ReqwestClient
The shipped client at its default timeout.
impl Default for ReqwestClient
The shipped client at its default timeout.
§Panics
When reqwest cannot build a client at all — a TLS backend that fails to initialize is the
one way. Default has no way to say so; a caller that would rather have the error uses
ReqwestClient::with_timeout or ReqwestClient::from_builder.