49 releases

✓ Uses Rust 2018 edition

0.10.0-alpha.2 Nov 12, 2019
0.9.22 Oct 9, 2019
0.9.19 Jul 19, 2019
0.9.12 Mar 20, 2019
0.1.0 Nov 10, 2016

#1 in HTTP client

Download history 35700/week @ 2019-07-30 36992/week @ 2019-08-06 40156/week @ 2019-08-13 43636/week @ 2019-08-20 38080/week @ 2019-08-27 42965/week @ 2019-09-03 39700/week @ 2019-09-10 45255/week @ 2019-09-17 46635/week @ 2019-09-24 57315/week @ 2019-10-01 57697/week @ 2019-10-08 56426/week @ 2019-10-15 59357/week @ 2019-10-22 50610/week @ 2019-10-29 54610/week @ 2019-11-05

207,782 downloads per month
Used in 1,338 crates (1,105 directly)

MIT/Apache

325KB
6.5K SLoC

reqwest

Travis CI Status Appveyor CI Status crates.io Documentation

An ergonomic, batteries-included HTTP Client for Rust.

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

NOTE: reqwest's master branch is currently preparing breaking changes, for most recently released code, look to the 0.9.x branch.

Example

Async:

use std::collections::HashMap;

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

Blocking:

use std::collections::HashMap;

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

Requirements

On Linux:

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 OpenSSL 1.1.

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.

Dependencies

~17MB
~436K SLoC