Struct actix_web::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) -> ClientBuilder where
T: 'static + Service<Request = Connect, Error = ConnectError>,
<T as Service>::Response: Connection,
<<T as Service>::Response as Connection>::Future: 'static,
<T as Service>::Future: 'static,
pub fn connector<T>(self, connector: T) -> ClientBuilder where
T: 'static + Service<Request = Connect, Error = ConnectError>,
<T as Service>::Response: Connection,
<<T as Service>::Response as Connection>::Future: 'static,
<T as Service>::Future: '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.
Maximum supported http major version Supported versions http/1.1, http/2
Indicates the initial window size (in octets) for HTTP2 stream-level flow control for received data.
The default value is 65,535 and is good for APIs, but not for big objects.
Indicates the initial window size (in octets) for HTTP2 connection-level flow control for received data.
The default value is 65,535 and is good for APIs, but not for big objects.
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) -> ClientBuilder where
V: IntoHeaderValue,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Debug,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
<V as IntoHeaderValue>::Error: Debug,
pub fn header<K, V>(self, key: K, value: V) -> ClientBuilder where
V: IntoHeaderValue,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Debug,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
<V as IntoHeaderValue>::Error: Debug,
Add default header. Headers added by this method get added to every request.
pub fn basic_auth<U>(self, username: U, password: Option<&str>) -> ClientBuilder where
U: Display,
pub fn basic_auth<U>(self, username: U, password: Option<&str>) -> ClientBuilder where
U: Display,
Set client wide HTTP basic authorization header
Set client wide HTTP bearer authentication header
Trait Implementations
Returns the “default value” for a type. Read more
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
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. 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