[−][src]Struct ntex::http::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() -> Self
[src]
pub fn connector<T>(mut self: Self, connector: T) -> Self where
T: Service<Request = Connect, Error = ConnectError> + 'static,
T::Response: Connection,
<T::Response as Connection>::Future: 'static,
T::Future: 'static,
[src]
T: Service<Request = Connect, Error = ConnectError> + 'static,
T::Response: Connection,
<T::Response as Connection>::Future: 'static,
T::Future: 'static,
Use custom connector service.
pub fn timeout(mut self: Self, timeout: Duration) -> Self
[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(mut self: Self) -> Self
[src]
Disable request timeout.
pub fn disable_redirects(mut self: Self) -> Self
[src]
Do not follow redirects.
Redirects are allowed by default.
pub fn max_redirects(mut self: Self, num: usize) -> Self
[src]
Set max number of redirects.
Max redirects is set to 10 by default.
pub fn no_default_headers(mut self: Self) -> Self
[src]
Do not add default request headers.
By default Date
and User-Agent
headers are set.
pub fn header<K, V>(mut self: 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>,
[src]
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.
pub fn basic_auth<U>(self, username: U, password: Option<&str>) -> Self where
U: Display,
[src]
U: Display,
Set client wide HTTP basic authorization header
pub fn bearer_auth<T>(self, token: T) -> Self 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]
Auto Trait Implementations
impl !RefUnwindSafe for ClientBuilder
[src]
impl !Send for ClientBuilder
[src]
impl !Sync for ClientBuilder
[src]
impl Unpin for ClientBuilder
[src]
impl !UnwindSafe for ClientBuilder
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub 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.
pub 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.
pub 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>,