96 releases

0.12.5 Jun 17, 2024
0.12.2 Mar 25, 2024
0.11.23 Dec 18, 2023
0.11.22 Oct 3, 2023
0.1.0 Nov 10, 2016

#6 in HTTP client

Download history 1219859/week @ 2024-03-25 1276956/week @ 2024-04-01 1242108/week @ 2024-04-08 1291055/week @ 2024-04-15 1328718/week @ 2024-04-22 1242903/week @ 2024-04-29 1244755/week @ 2024-05-06 1326690/week @ 2024-05-13 1347608/week @ 2024-05-20 1308709/week @ 2024-05-27 1489181/week @ 2024-06-03 1477288/week @ 2024-06-10 1477644/week @ 2024-06-17 1517302/week @ 2024-06-24 1449717/week @ 2024-07-01 1520107/week @ 2024-07-08

6,044,908 downloads per month
Used in 13,016 crates (9,160 directly)

MIT/Apache

610KB
12K SLoC

reqwest

crates.io Documentation MIT/Apache-2 licensed CI

An ergonomic, batteries-included HTTP Client for Rust.

  • Async and blocking Clients
  • Plain bodies, JSON, urlencoded, multipart
  • Customizable redirect policy
  • HTTP Proxies
  • HTTPS via system-native TLS (or optionally, rustls)
  • Cookie Store
  • WASM

Example

This asynchronous example uses Tokio and enables some optional features, so your Cargo.toml could look like this:

[dependencies]
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }

And then the code:

use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let resp = reqwest::get("https://httpbin.org/ip")
        .await?
        .json::<HashMap<String, String>>()
        .await?;
    println!("{resp:#?}");
    Ok(())
}

Commercial Support

For private advice, support, reviews, access to the maintainer, and the like, reach out for commercial support.

Requirements

On Linux:

  • OpenSSL with headers. See https://docs.rs/openssl for supported versions and more details. Alternatively you can enable the native-tls-vendored feature to compile a copy of OpenSSL.

On Windows and macOS:

  • Nothing.

Reqwest uses rust-native-tls, which will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use the available OpenSSL or fail to build if not found.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Sponsors

Support this project by becoming a sponsor.

Dependencies

~3–25MB
~434K SLoC