pub struct ReqwestClient { /* private fields */ }reqwest only.Expand description
The HttpClient the SDK ships, over reqwest. 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 new() -> Result<ReqwestClient, Error>
pub fn new() -> Result<ReqwestClient, Error>
A client with the SDK’s default per-attempt timeout.
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 timeout. Two settings the builder carries are replaced, because each would act beneath the SDK where it cannot see: redirects are never followed (the SDK follows its own) and reqwest’s own retries are off (SPEC §7’s attempt budget counts every request).
Default headers are the caller’s and cannot be taken back: reqwest adds them to
every request that lacks the header, including a download’s second hop, which must
go out bare. A builder carrying a default Authorization or Cookie would send it
to the storage host, so give it none — the SDK sets every header it needs per
request.