Skip to main content

Crate cdk_http_client

Crate cdk_http_client 

Source
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§

HttpClient
HTTP client wrapper
HttpClientBuilder
HTTP client builder for configuring proxy and TLS settings
RawResponse
Raw HTTP response with status code and body access
RequestBuilder
HTTP request builder for complex requests

Enums§

HttpError
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