pub struct HttpConfigBuilder { /* private fields */ }Expand description
Builder for HttpConfig.
Implementations§
Source§impl HttpConfigBuilder
impl HttpConfigBuilder
Sourcepub fn max_redirects(self, n: u32) -> Self
pub fn max_redirects(self, n: u32) -> Self
Cap the redirect chain. ureq’s default is 10.
Sourcepub fn max_redirects_will_error(self, v: bool) -> Self
pub fn max_redirects_will_error(self, v: bool) -> Self
If true, hitting HttpConfigBuilder::max_redirects is an
error (default); if false, the last 3xx response is returned.
Sourcepub fn redirect_auth_policy(self, p: RedirectAuthPolicy) -> Self
pub fn redirect_auth_policy(self, p: RedirectAuthPolicy) -> Self
How Authorization should be carried across redirects. Default
is RedirectAuthPolicy::Never.
Sourcepub fn user_agent(self, ua: impl Into<String>) -> Self
pub fn user_agent(self, ua: impl Into<String>) -> Self
Override the User-Agent request header. ureq’s own default
(ureq/<version>) is used when this is left unset.
Sourcepub fn https_only(self, v: bool) -> Self
pub fn https_only(self, v: bool) -> Self
When true, the agent refuses any non-https URL, including
redirect targets. Default false.
Sourcepub fn timeout_global(self, d: Option<Duration>) -> Self
pub fn timeout_global(self, d: Option<Duration>) -> Self
End-to-end timeout for an entire call. None = unlimited.
Sourcepub fn timeout_connect(self, d: Option<Duration>) -> Self
pub fn timeout_connect(self, d: Option<Duration>) -> Self
Connect timeout (TCP + TLS handshake). None = unlimited.
Sourcepub fn build(self) -> HttpConfig
pub fn build(self) -> HttpConfig
Finalise the policy.
Trait Implementations§
Source§impl Clone for HttpConfigBuilder
impl Clone for HttpConfigBuilder
Source§fn clone(&self) -> HttpConfigBuilder
fn clone(&self) -> HttpConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpConfigBuilder
impl RefUnwindSafe for HttpConfigBuilder
impl Send for HttpConfigBuilder
impl Sync for HttpConfigBuilder
impl Unpin for HttpConfigBuilder
impl UnsafeUnpin for HttpConfigBuilder
impl UnwindSafe for HttpConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more