http-request 22.14.1

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::*;

/// Process-wide pool of idle asynchronous HTTP/1.1 keep-alive connections.
pub(crate) static ASYNC_H1_POOL: OnceLock<Mutex<AsyncH1PoolMap>> = OnceLock::new();

/// Process-wide pool of idle synchronous HTTP/1.1 keep-alive connections.
pub(crate) static SYNC_H1_POOL: OnceLock<Mutex<SyncH1PoolMap>> = OnceLock::new();

/// Process-wide pool of multiplexed asynchronous HTTP/2 connection senders.
pub(crate) static ASYNC_H2_POOL: OnceLock<Mutex<AsyncH2PoolMap>> = OnceLock::new();

thread_local! {
    /// Thread-local pool of reusable byte buffers avoiding per-request response allocations.
    pub(crate) static CLIENT_BUFFER_POOL: RefCell<Vec<Vec<u8>>> = const { RefCell::new(Vec::new()) };
}