#http #client #request

build http_req

simple and lightweight HTTP client with built-in HTTPS support

14 unstable releases (3 breaking)

✓ Uses Rust 2018 edition

new 0.4.6 Mar 18, 2019
0.4.5 Mar 8, 2019
0.4.4 Feb 9, 2019
0.4.3 Jan 19, 2019
0.1.2 Sep 3, 2018

#5 in HTTP client

Download history 919/week @ 2018-12-03 1173/week @ 2018-12-10 1243/week @ 2018-12-17 872/week @ 2018-12-24 768/week @ 2018-12-31 834/week @ 2019-01-07 1010/week @ 2019-01-14 750/week @ 2019-01-21 726/week @ 2019-01-28 844/week @ 2019-02-04 1580/week @ 2019-02-11 1592/week @ 2019-02-18 2366/week @ 2019-02-25 2752/week @ 2019-03-04 2466/week @ 2019-03-11

5,932 downloads per month
Used in 41 crates (3 directly)

MIT license

67KB
1.5K SLoC

http_req

Build Status Crates.io

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.4", default-features = false, features = ["rust-tls"]}

License

Licensed under MIT.

Dependencies

~2MB
~47K SLoC