Expand description
HTTP client abstraction for CDK
This crate provides an HTTP client wrapper that abstracts the underlying HTTP library (reqwest). Using this crate allows other CDK crates to avoid direct dependencies on reqwest.
§Example
use cdk_http_client::{HttpClient, Response};
use serde::Deserialize;
#[derive(Deserialize)]
struct ApiResponse {
message: String,
}
async fn example() -> Response<ApiResponse> {
let client = HttpClient::new();
client.fetch("https://api.example.com/data").await
}Structs§
- Http
Client - HTTP client wrapper
- Http
Client Builder - HTTP client builder for configuring proxy and TLS settings
- RawResponse
- Raw HTTP response with status code and body access
- Request
Builder - HTTP request builder for complex requests
Enums§
- Http
Error - HTTP errors that can occur during requests
Functions§
- fetch
- Convenience function for simple GET requests (replaces reqwest::get)
Type Aliases§
- Response
- HTTP Response type - generic over the body type R and error type E This is the primary return type for all HTTP operations