1fn main() {
2 match tinyquest::request(
3 http::Request::head("https://icelk.dev/capturing/hi!")
4 .body(Vec::new())
5 .expect("Failed to build request."),
6 tinyquest::Config::default(),
7 )
8 .and_then(|mut client| client.follow_redirects())
9 {
10 Ok(response) => {
11 let (parts, body) = response.into_parts();
12 println!(
13 "Headers: '{:#?}'\n\
14 Body: '{}'",
15 parts.headers,
16 String::from_utf8_lossy(&body),
17 );
18 }
19 Err(err) => {
20 panic!("An error occurred! {:?}", err);
21 }
22 }
23}