Skip to content

simple HTTP client with built-in HTTPS support

License

Notifications You must be signed in to change notification settings

mesalock-linux/http_req-sgx

 
 

Repository files navigation

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

License

Licensed under MIT.

About

simple HTTP client with built-in HTTPS support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 48.2%
  • C 46.3%
  • Makefile 2.8%
  • C++ 2.7%