reqwest_enum/
lib.rs

1//! `reqwest-enum` simplifies making HTTP(S) requests by providing a structured way to define API targets (`target::Target` trait), manage request providers (`provider::Provider`), and handle authentication (`http::AuthMethod`).
2//!
3//! # Key Features
4//!
5//! *   **Target Trait**: Define API endpoints by implementing `target::Target`.
6//! *   **Provider Pattern**: Centralize request logic and client configuration with `provider::Provider`.
7//! *   **Flexible Authentication**: Use `http::AuthMethod` for Basic, Bearer, or custom closure-based authentication (e.g., `AuthMethod::header_api_key`).
8//! *   **Centralized Timeout**: Set a default timeout at the `Provider` level.
9//! *   **Middleware Support**: Optional `reqwest-middleware` integration (via `middleware` feature).
10//! *   **JSON-RPC Support**: Optional helpers for JSON-RPC 2.0, including batching (via `jsonrpc` feature).
11//!
12//! # Getting Started
13//!
14//! 1.  Define an enum/struct for your API target(s).
15//! 2.  Implement `target::Target` for your type.
16//! 3.  Create a `provider::Provider` instance.
17//! 4.  Use the provider to make requests.
18//!
19//! (See examples directory and specific item documentation for detailed usage.)
20
21
22pub mod error;
23pub use error::Error;
24pub mod http;
25pub mod provider;
26pub mod target;
27
28#[cfg(feature = "jsonrpc")]
29pub mod jsonrpc;