Expand description
Reusable HTTP client with pre-configured TLS, timeouts, and user agent.
This module provides Client as the recommended base HTTP client for all
network requests in the application. It is pre-configured with:
- TLS using
webpki-rootscertificates (no system cert store required) - 30 second request timeout
- User agent identifying the application
ยงExample
use cadmus_core::http::Client;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new()?;
client.get("https://example.com").send()?;
Ok(())
}Structsยง
- Client
- Pre-configured HTTP client for making network requests.
Enumsยง
- Chunked
Download Error - Error types that can occur during a chunked HTTP download.
- Http
Error
Constantsยง
- CLIENT_
TIMEOUT_ SECS - INITIAL_
CHUNK_ ๐SIZE - MAX_
CHUNK_ ๐SIZE - MAX_
RETRIES ๐ - MIN_
CHUNK_ ๐SIZE - TARGET_
CHUNK_ ๐SECS - Target 80% of the HTTP timeout to leave headroom for throughput variance.
- USER_
AGENT ๐
Functionsยง
- build_
root_ ๐store