logo

Struct awc::ClientBuilder[][src]

pub struct ClientBuilder<S = (), M = ()> { /* 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

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.

Set local IP Address the connector would use for establishing connection.

Maximum supported HTTP major version.

Supported versions are HTTP/1.1 and HTTP/2.

Do not follow redirects.

Redirects are allowed by default.

Set max number of redirects.

Max redirects is set to 10 by default.

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.

Do not add fundamental default request headers.

By default Date and User-Agent headers are set.

Add default header.

Headers added by this method get added to every request unless overriden by .

Panics

Panics if header name or value is invalid.

Set client wide HTTP basic authorization header

Set client wide HTTP bearer authentication header

Registers middleware, in the form of a middleware component (type), that runs during inbound and/or outbound processing in the request life-cycle (request -> response), modifying request/response as necessary, across all requests managed by the Client.

Finish build process and create Client instance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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