[−][src]Struct actix_web::client::ClientBuilder
An HTTP Client builder
This type can be used to construct an instance of Client
through a
builder-like pattern.
Implementations
impl ClientBuilder
[src]
pub fn new() -> ClientBuilder
[src]
pub fn connector<T>(self, connector: T) -> ClientBuilder where
T: Service<Request = Connect, Error = ConnectError> + 'static,
<T as Service>::Response: Connection,
<<T as Service>::Response as Connection>::Future: 'static,
<T as Service>::Future: 'static,
[src]
T: Service<Request = Connect, Error = ConnectError> + 'static,
<T as Service>::Response: Connection,
<<T as Service>::Response as Connection>::Future: 'static,
<T as Service>::Future: 'static,
Use custom connector service.
pub fn timeout(self, timeout: Duration) -> ClientBuilder
[src]
Set request timeout
Request timeout is the total time before a response must be received. Default value is 5 seconds.
pub fn disable_timeout(self) -> ClientBuilder
[src]
Disable request timeout.
pub fn disable_redirects(self) -> ClientBuilder
[src]
Do not follow redirects.
Redirects are allowed by default.
pub fn max_http_version(self, val: Version) -> ClientBuilder
[src]
Maximum supported http major version Supported versions http/1.1, http/2
pub fn initial_window_size(self, size: u32) -> ClientBuilder
[src]
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.
pub fn initial_connection_window_size(self, size: u32) -> ClientBuilder
[src]
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.
pub fn max_redirects(self, num: usize) -> ClientBuilder
[src]
Set max number of redirects.
Max redirects is set to 10 by default.
pub fn no_default_headers(self) -> ClientBuilder
[src]
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,
[src]
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,
[src]
U: Display,
Set client wide HTTP basic authorization header
pub fn bearer_auth<T>(self, token: T) -> ClientBuilder where
T: Display,
[src]
T: Display,
Set client wide HTTP bearer authentication header
pub fn finish(self) -> Client
[src]
Finish build process and create Client
instance.
Trait Implementations
impl Default for ClientBuilder
[src]
fn default() -> ClientBuilder
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,