tower-http-client
This library provides middlewares and various utilities for HTTP-clients.
Thus, it extends the tower_http
functionality for creating HTTP clients
using tower
middlewares.
At the moment, the de facto standard client library is reqwest
, which is
poorly compatible with the tower
services, but thanks to the
tower_reqwest
crate, it can be used with the any tower_http
layers.
The first goal of the project is to create a more flexible and extensible
alternative for reqwest_middleware
.
Examples
Simple client usage with layers from the tower_http
.
use ;
use ;
use ServiceBuilderExt;
use ;
use HttpClientLayer;
/// Implementation agnostic HTTP client.
type HttpClient = BoxCloneService;
/// Creates HTTP client with Tower layers on top of the given client.
async