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.
§Example
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§
- support for Transfer-Encoding: chunked
- error system used around the library.
- creating and sending HTTP requests
- parsing server response
- TCP stream
- secure connection over TLS
- uri operations