Crates.io | request |
lib.rs | request |
version | 0.0.8 |
source | src |
created_at | 2015-04-10 13:08:34.847529 |
updated_at | 2015-12-11 23:55:29.371301 |
description | Request |
homepage | https://github.com/ghmlee/rust-request |
repository | https://github.com/ghmlee/rust-request.git |
max_upload_size | |
id | 1831 |
size | 14,184 |
Documentation is available here.
[dependencies]
request = "0.0.7"
extern crate request;
use std::collections::HashMap;
let url = "https://github.com/ghmlee";
let mut headers: HashMap<String, String> = HashMap::new();
headers.insert("Connection".to_string(), "close".to_string());
let res = match request::get(&url, &mut headers) {
Ok(res) => res,
Err(e) => { println!("{}", e); return; }
};
println!("{}", res.http_version);
println!("{}", res.status_code);
println!("{}", res.status_message);
println!("{}", res.body);