Crate http_req

source ·
Expand description

Simple HTTP client with built-in HTTPS support. Currently it’s in heavy development and may frequently change.

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());
}

Modules

  • error system
  • creating and sending HTTP requests
  • parsing server response
  • secure connection over TLS
  • uri operations