http_req 0.7.2

simple and lightweight HTTP client with built-in HTTPS support


Build Status

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


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.


Basic GET request

use http_req::request;

fn main() {
    let mut writer = Vec::new(); //container for body of a response
    let res = request::get("", &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:

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


Licensed under MIT.