| Crates.io | armature-http-client |
| lib.rs | armature-http-client |
| version | 0.1.1 |
| created_at | 2025-12-26 20:39:10.749042+00 |
| updated_at | 2025-12-30 22:13:56.237029+00 |
| description | HTTP client with retry, circuit breaker, and timeout support for Armature |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006218 |
| size | 107,317 |
HTTP client for the Armature framework.
[dependencies]
armature-http-client = "0.1"
use armature_http_client::HttpClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = HttpClient::new()
.timeout(Duration::from_secs(30))
.retry(3)
.build();
// GET request
let response = client.get("https://api.example.com/users")
.send()
.await?;
// POST with JSON
let user = client.post("https://api.example.com/users")
.json(&CreateUser { name: "John" })
.send()
.await?;
Ok(())
}
let client = HttpClient::new()
.circuit_breaker(CircuitBreakerConfig {
failure_threshold: 5,
success_threshold: 2,
timeout: Duration::from_secs(30),
})
.build();
MIT OR Apache-2.0