1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! HTTP client infrastructure for `ModKit`
//!
//! This crate provides a hyper-based HTTP client with:
//! - Automatic TLS via rustls (HTTPS only by default)
//! - Connection pooling
//! - Configurable timeouts
//! - Automatic retries with exponential backoff
//! - User-Agent header injection
//! - Concurrency limiting
//! - **Transparent response decompression** (gzip, brotli, deflate)
//! - Optional OpenTelemetry tracing (feature-gated)
//!
//! # Transparent Decompression
//!
//! The client automatically:
//! - Sends `Accept-Encoding: gzip, br, deflate` header on all requests
//! - Decompresses response bodies based on `Content-Encoding` header
//! - Applies body size limits to **decompressed** bytes (protecting against zip bombs)
//!
//! No configuration is required; decompression is always enabled.
//!
//! # Example
//!
//! ```ignore
//! use modkit_http::{HttpClient, HttpClientBuilder};
//! use std::time::Duration;
//!
//! let client = HttpClient::builder()
//! .timeout(Duration::from_secs(10))
//! .user_agent("my-app/1.0")
//! .build()?;
//!
//! // reqwest-like API: response has body-reading methods
//! // Compressed responses are automatically decompressed
//! let data: MyData = client
//! .get("https://example.com/api")
//! .send()
//! .await?
//! .json()
//! .await?;
//! ```
pub use HttpClientBuilder;
pub use HttpClient;
pub use ;
pub use ;
pub use ;
pub use RequestBuilder;
pub use ;