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::AuthMethod
for Basic, Bearer, or custom closure-based authentication (e.g.,AuthMethod::header_api_key
). - Centralized Timeout: Set a default timeout at the
Provider
level. - Middleware Support: Optional
reqwest-middleware
integration (viamiddleware
feature). - JSON-RPC Support: Optional helpers for JSON-RPC 2.0, including batching (via
jsonrpc
feature).
§Getting Started
- Define an enum/struct for your API target(s).
- Implement
target::Target
for your type. - Create a
provider::Provider
instance. - Use the provider to make requests.
(See examples directory and specific item documentation for detailed usage.)
Re-exports§
pub use error::Error;