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
//! Async HTTP client with redacting auth, resilience, destination hardening, and error handling.
//!
//! # Features
//!
//! - Async HTTP client built on `reqwest`
//! - Support for Bearer, Basic, and API key authentication with redacted secret storage
//! - Configurable timeouts, headers, redirects, and injected resilience policies
//! - URL building with base URL support and destination validation
//! - Bounded response-body reads
//! - JSON request/response serialization
//! - Integrated error handling with `rskit-errors`
//!
//! Authentication secrets are stored in [`rskit_security::SecretString`] inside
//! [`Auth`], so [`Auth`] and [`HttpClientConfig`] debug output redacts bearer
//! tokens, basic passwords, and API-key values. Prefer [`HttpClientConfig::with_auth`]
//! or request auth helpers over raw credential headers.
//!
//! # Example
//!
//! ```no_run
//! use rskit_httpclient::{HttpClient, HttpClientConfig, Request};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = HttpClientConfig::new()
//! .with_base_url("https://api.example.com")
//! .with_user_agent("my-app/1.0");
//!
//! let client = HttpClient::new(config)?;
//!
//! // Simple GET request
//! let resp = client.get("/users").await?;
//! let text = resp.text()?;
//! println!("{}", text);
//!
//! // GET request with bearer token
//! let resp = client.send(
//! Request::get("/protected")
//! .bearer_token("secret-token")
//! ).await?;
//!
//! // POST request with JSON
//! let body = serde_json::json!({"name": "Alice"});
//! let resp = client.post("/users", &body).await?;
//!
//! Ok(())
//! }
//! ```
pub use Auth;
pub use HttpClient;
pub use HttpClientConfig;
pub use DestinationPolicy;
pub use ;
pub use ;