Skip to main content

cdk_http_client/
lib.rs

1//! HTTP client abstraction for CDK
2//!
3//! This crate provides an HTTP client wrapper that abstracts the underlying HTTP library (reqwest).
4//! Using this crate allows other CDK crates to avoid direct dependencies on reqwest.
5//!
6//! # Example
7//!
8//! ```no_run
9//! use cdk_http_client::{HttpClient, Response};
10//! use serde::Deserialize;
11//!
12//! #[derive(Deserialize)]
13//! struct ApiResponse {
14//!     message: String,
15//! }
16//!
17//! async fn example() -> Response<ApiResponse> {
18//!     let client = HttpClient::new();
19//!     client.fetch("https://api.example.com/data").await
20//! }
21//! ```
22
23mod client;
24mod error;
25mod request;
26mod response;
27
28pub use client::{fetch, HttpClient, HttpClientBuilder};
29pub use error::HttpError;
30pub use request::RequestBuilder;
31pub use response::{RawResponse, Response};