Skip to content

Instantly share code, notes, and snippets.

@marcmo
Created May 14, 2015 05:30
Show Gist options
  • Save marcmo/31b09a73e3f42227b391 to your computer and use it in GitHub Desktop.
Save marcmo/31b09a73e3f42227b391 to your computer and use it in GitHub Desktop.
extern crate hyper;
use hyper::Client;
use hyper::header::HeaderFormat;
fn main() {
let mut client = Client::new();
let mut res = client.head("http://example.org/")
.send().unwrap();
println!("StatusCode: {}", res.status);
println!("contenttype: {}", res.headers.get::<HeaderFormat::ContentType>());
// println!("contenttype: {}", res.headers.get_raw("Content-Type").unwrap());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment