http-request 21.9.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
use super::*;

/// Configuration for an outgoing HTTP request.
///
/// Field-by-field setters are generated by `lombok-macros` (`#[set]` /
/// `#[set(type(...))]`), aligning with `hyperlane-core`'s `ServerConfig` /
/// `RequestConfig` style — see `hyperlane-standards §8`.
///
/// For most use cases, prefer the fluent setters on
/// [`crate::RequestBuilder`]. This type is the underlying data passed to
/// `HttpRequest` and is also returned by [`HttpRequest::config`].
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct RequestConfig {
    /// Per-read buffer size in bytes.
    pub buffer_size: usize,
    /// Request timeout in milliseconds.
    pub timeout: u64,
    /// Maximum number of redirects to follow (0 = no redirect).
    pub max_redirect_times: usize,
    /// HTTP version (`HttpVersion::Http1_1` / `HttpVersion::Http2`).
    pub http_version: HttpVersion,
    /// Whether to follow redirects automatically.
    pub redirect: bool,
    /// Whether to automatically decode response bodies (gzip / deflate / br).
    pub decode: bool,
    /// Optional proxy configuration. `None` means direct connection.
    pub proxy: Option<Proxy>,
}