Crates.io | httpclient |
lib.rs | httpclient |
version | 0.23.18 |
source | src |
created_at | 2022-03-18 11:34:54.686689 |
updated_at | 2024-10-17 18:51:09.481142 |
description | HTTP client with middleware. Middleware provides composable support for record/replay, logging, exponential backoff, and more. |
homepage | https://github.com/kurtbuilds/httpclient |
repository | https://github.com/kurtbuilds/httpclient |
max_upload_size | |
id | 552640 |
size | 127,506 |
httpclient
is a user-friendly http client in Rust. Where possible, it closely mimics the reqwest
API. Why build a
new http client?
httpclient::{Request, Response}
objects are serde-serializable, which enables record/replay functionality. See
the example below to see it in action.httpclient
provides an API for user-extensible middleware. Built-in middleware includes redirect, retry, logging,
and record/replay.httpclient
provides a built-in Error
type that can return the Http request, which includes the status code, headers,
and response body.httpclient
provides convenience methods that reqwest
does not support. The most important is the IntoFuture
implementation, which awaits both the request and the response body, which simplifies the scenario where you want to return
the request body even in error cases.For Oauth2, use Oauth2Flow
and the Oauth2
middleware from httpclient_oauth2
.