Crate http_req

Source
Expand description

Simple HTTP client with built-in HTTPS support.

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

§Examples

Basic GET request

use http_req::request;

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

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

Modules§

chunked
support for Transfer-Encoding: chunked
error
error system used around the library.
request
creating and sending HTTP requests
response
parsing server response
stream
TCP stream
tls
secure connection over TLS
uri
uri operations