#http #client #request

http_req

simple and lightweight HTTP client with built-in HTTPS support

20 releases (4 breaking)

✓ Uses Rust 2018 edition

0.5.0 May 12, 2019
0.4.6 Mar 18, 2019
0.4.2 Dec 28, 2018
0.3.1 Nov 21, 2018

#11 in HTTP client

Download history 793/week @ 2019-01-27 850/week @ 2019-02-03 1496/week @ 2019-02-10 1595/week @ 2019-02-17 2382/week @ 2019-02-24 2633/week @ 2019-03-03 2513/week @ 2019-03-10 2954/week @ 2019-03-17 2131/week @ 2019-03-24 1594/week @ 2019-03-31 1782/week @ 2019-04-07 1510/week @ 2019-04-14 1316/week @ 2019-04-21 1033/week @ 2019-04-28 719/week @ 2019-05-05

7,818 downloads per month
Used in 15 crates (2 directly)

MIT license

73KB
2K SLoC

http_req

Build Status Crates.io Docs.rs

Simple and lightweight HTTP client with built-in HTTPS support. Currently it's in heavy development and may frequently change.

Requirements

http_req by default uses rust-native-tls, which uses TLS framework provided by OS on Windows and macOS, and OpenSSL on all other platforms. But it also supports rus-tls.

Example

Basic GET request

use http_req::request;

fn main() {
    let mut writer = Vec::new(); //container for body of a response
    let res = request::get("https://doc.rust-lang.org/", &mut writer).unwrap();

    println!("Status: {} {}", res.status_code(), res.reason());
}

How to use with rustls:

In order to use http_req with rustls in your project, add following lines to Cargo.toml:

[dependencies]
http_req  = {version="^0.5", default-features = false, features = ["rust-tls"]}

License

Licensed under MIT.

Dependencies

~2MB
~49K SLoC