Struct chttp::client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

An HTTP client for making requests.

The client maintains a connection pool internally and is expensive to create, so we recommend re-using your clients instead of discarding and recreating them.

Implementations

Create a new HTTP client using the default configuration.

If the client fails to initialize, an error will be returned.

Create a new builder for building a custom client.

Sends an HTTP GET request.

The response body is provided as a stream that may only be consumed once.

Sends an HTTP HEAD request.

Sends an HTTP POST request.

The response body is provided as a stream that may only be consumed once.

Sends an HTTP PUT request.

The response body is provided as a stream that may only be consumed once.

Sends an HTTP DELETE request.

The response body is provided as a stream that may only be consumed once.

Sends a request and returns the response.

The request may include extensions to customize how it is sent. If the request contains an Options struct as an extension, then those options will be used instead of the default options this client is configured with.

The response body is provided as a stream that may only be consumed once.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.