http-request 23.3.0

http-request is a lightweight, efficient library for building, sending, and handling HTTP/HTTPS requests in Rust applications. It provides a simple and intuitive API, allowing developers to easily interact with web services, whether they use the "HTTP" or "HTTPS" protocol. The library supports various HTTP methods, custom headers, request bodies, timeout, automatic handling of redirects (including detecting redirect loops), and enhanced response body decoding (both automatic and manual), enabling fast and secure communication. Whether working with secure "HTTPS" connections or standard "HTTP" requests, the library is optimized for performance, minimal resource usage, and easy integration into Rust projects.
Documentation
<div align="center">

# http-request

**Sync & Async HTTP/1.1 + HTTP/2 Client**

[![crates.io](https://flat.badgen.net/crates/v/http-request)](https://crates.io/crates/http-request)
[![docs.rs](https://img.shields.io/docsrs/http-request?style=flat-square)](https://docs.rs/http-request)
[![Rust 2024](https://img.shields.io/badge/edition-2024-orange.svg?style=flat-square)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](../LICENSE)

[Workspace Overview](../README.md) ยท [API Docs](https://docs.rs/http-request/latest/)

</div>

---

## Overview

Ergonomic HTTP client supporting reusable [`HttpClient`] instances (keep-alive pooling enabled by default, base URL resolution, default headers, Bearer/Basic auth, timeouts, retries, proxies, and custom PEM roots) alongside per-request [`RequestBuilder`] helpers (`send`, `send_async`, `try_body_json`, multipart/form uploads) and [`HttpResponse`] inspection methods (`error_for_status`, `content_type`, `content_length`, `location`, `text_strict`, `set_cookies`).

This crate is a member of the [`hyperlane`](../README.md) unified Rust 2024 workspace. All plugin crates are opt-in and transparent (`Status::Continue`) when unconfigured.

## Responsibilities & Module Layout

- `client` โ€” Reusable [`HttpClient`] and [`HttpClientBuilder`] with shared connection pooling, base URLs, default headers, auth helpers, timeouts, retries, proxies, and custom roots
- `request` / `pool` / `protocol` / `tls` โ€” Sync and Tokio-async HTTP/1.1 + HTTP/2 transports, 16-stripe keep-alive pools, RFC 9110/3986 redirect handling with credential stripping, and single-pass chunked/compressed decoding
- `response` โ€” [`HttpResponse`] wire parser, zero-copy in-place decoding, multi-`Set-Cookie` preservation, and typed body/header helpers

## Installation

```sh
cargo add http-request
```

## Verification

Run crate-scoped formatting, lint, and test gates from the workspace root:

```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p http-request --all-features --all-targets -- -D warnings
cargo test -p http-request --all-features
```

## Documentation & Governance

- Update this `README.md` alongside any public API, plugin contract, or module-boundary change.
- Project standards and release workflows live in [`../.agents/skills/hyperlane/SKILL.md`]../.agents/skills/hyperlane/SKILL.md.

## License

This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.

## Contact

For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).