Expand description
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).
§Key Features
- Target Trait: Define API endpoints by implementing
target::Target. - Provider Pattern: Centralize request logic and client configuration with
provider::Provider. - Flexible Authentication: Use
http::AuthMethodfor Basic, Bearer, or custom closure-based authentication (e.g.,AuthMethod::header_api_key). - Centralized Timeout: Set a default timeout at the
Providerlevel. - Middleware Support: Optional
reqwest-middlewareintegration (viamiddlewarefeature). - JSON-RPC Support: Optional helpers for JSON-RPC 2.0, including batching (via
jsonrpcfeature).
§Getting Started
- Define an enum/struct for your API target(s).
- Implement
target::Targetfor your type. - Create a
provider::Providerinstance. - Use the provider to make requests.
(See examples directory and specific item documentation for detailed usage.)
Re-exports§
pub use error::Error;