Skip to main content

Module http

Module http 

Source
Expand description

HTTP client abstraction for dependency injection.

This module provides an HTTP client trait that can be mocked for testing, along with a default implementation using reqwest.

§Example

// Using the default client
let client = ReqwestHttpClient::new();

// Or in tests, use the mock
let mock = MockHttpClient::new()
    .with_response(HttpResponse::ok(b"response body".to_vec()));

Structs§

HttpResponse
HTTP response from a request.
MockHttpClient
Mock HTTP client for testing.
MockRequest
A recorded HTTP request made to the mock client.
ReqwestHttpClient
Default HTTP client implementation using reqwest.

Traits§

HttpClient
HTTP client trait for making web requests.