#ureq #async #http

http-lib

High-level, asynchronous API for ureq, a safe HTTP client

1 unstable release

0.1.0 Oct 27, 2024

#8 in #ureq

Download history 87/week @ 2025-05-22 72/week @ 2025-05-29 87/week @ 2025-06-05 87/week @ 2025-06-12 126/week @ 2025-06-19 140/week @ 2025-06-26 119/week @ 2025-07-03 309/week @ 2025-07-10 148/week @ 2025-07-17 199/week @ 2025-07-24 236/week @ 2025-07-31 125/week @ 2025-08-07 78/week @ 2025-08-14 146/week @ 2025-08-21 384/week @ 2025-08-28 323/week @ 2025-09-04

952 downloads per month
Used in 10 crates (3 directly)

MIT license

12KB
89 lines

🌐 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 runtime
  • async-std: enables the async-std async runtime
  • rustls: enables the rustls crypto
  • native-tls: enables the native-tls crypto
  • vendored: 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

nlnet

Special thanks to the NLnet foundation and the European Commission that helped the project to receive financial support from various programs:

If you appreciate the project, feel free to donate using one of the following providers:

GitHub Ko-fi Buy Me a Coffee Liberapay thanks.dev PayPal

Dependencies

~12–28MB
~467K SLoC