Struct ntex::http::client::ClientBuilder [−][src]
pub struct ClientBuilder { /* fields omitted */ }
Expand description
An HTTP Client builder
This type can be used to construct an instance of Client
through a
builder-like pattern.
Implementations
pub fn connector<T>(self, connector: T) -> Self where
T: Service<Connect, Response = Connection, Error = ConnectError> + 'static,
pub fn connector<T>(self, connector: T) -> Self where
T: Service<Connect, Response = Connection, Error = ConnectError> + 'static,
Use custom connector service.
Set request timeout.
Request timeout is the total time before a response must be received. Default value is 5 seconds.
Disable request timeout.
Do not follow redirects.
Redirects are allowed by default.
Set max number of redirects.
Max redirects is set to 10 by default.
Do not add default request headers.
By default Date
and User-Agent
headers are set.
pub fn header<K, V>(self, key: K, value: V) -> Self where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Debug + Into<HttpError>,
<HeaderValue as TryFrom<V>>::Error: Debug + Into<HttpError>,
pub fn header<K, V>(self, key: K, value: V) -> Self where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Debug + Into<HttpError>,
<HeaderValue as TryFrom<V>>::Error: Debug + Into<HttpError>,
Add default header. Headers added by this method get added to every request.
Set client wide HTTP basic authorization header
Set client wide HTTP bearer authentication header
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ClientBuilder
impl !Send for ClientBuilder
impl !Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more