Skip to main content

head/
head.rs

1use http_req::request;
2
3fn main() {
4    // Sends a HTTP HEAD request and processes the response.
5    let res = request::head("https://www.rust-lang.org/learn").unwrap();
6
7    // Prints the details about the response.
8    println!("Status: {} {}", res.status_code(), res.reason());
9    println!("Headers: {}", res.headers());
10}