#http #client #request

http_req

simple and lightweight HTTP client with built-in HTTPS support

21 unstable releases (4 breaking)

✓ Uses Rust 2018 edition

0.5.1 Jul 11, 2019
0.4.11 Apr 30, 2019
0.4.6 Mar 18, 2019
0.4.2 Dec 28, 2018
0.3.1 Nov 21, 2018

#8 in HTTP client

Download history 1708/week @ 2019-03-28 1830/week @ 2019-04-04 1430/week @ 2019-04-11 1272/week @ 2019-04-18 1290/week @ 2019-04-25 851/week @ 2019-05-02 717/week @ 2019-05-09 772/week @ 2019-05-16 1014/week @ 2019-05-23 1308/week @ 2019-05-30 1092/week @ 2019-06-06 1491/week @ 2019-06-13 1176/week @ 2019-06-20 1165/week @ 2019-06-27 1455/week @ 2019-07-04

4,903 downloads per month
Used in 17 crates (3 directly)

MIT license

93KB
2K SLoC

http_req

Build Status Crates.io Docs.rs

Simple and lightweight HTTP client with built-in HTTPS support.

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
~45K SLoC