Expand description
§🌐 http-lib
High-level, asynchronous API for ureq
, a safe HTTP client.
§Features
- Wraps HTTP agent with sane defaults
- Supports pool of agent (soon)
- Supports tokio and async-std async runtimes
- Supports rustls and openssl crypto libs
The library comes with 5 cargo features, including 2 default ones:
tokio
: enables the tokio async runtimeasync-std
: enables the async-std async runtimerustls
: enables the rustls cryptonative-tls
: enables the native-tls cryptovendored
: compiles and statically link to a copy of non-Rust vendors like OpenSSL
§Example
use http::Client;
#[tokio::main]
async fn main() {
let client = Client::new();
let res = client.send(|agent| agent.get("https://crates.io").call()).await.unwrap();
assert_eq!(200, res.status());
}
See the full API documentation on docs.rs.
§Sponsoring
Special thanks to the NLnet foundation and the European Commission that helped the project to receive financial support from various programs:
- NGI Assure in 2022
- NGI Zero Entrust in 2023
- NGI Zero Core in 2024 (still ongoing)
If you appreciate the project, feel free to donate using one of the following providers:
Re-exports§
pub use ureq;
Structs§
- Client
- The HTTP client structure.
Enums§
- Error
- The global
Error
enum of the library.
Type Aliases§
- Result
- The global
Result
alias of the library.