request

Crates.iorequest
lib.rsrequest
version0.0.8
sourcesrc
created_at2015-04-10 13:08:34.847529
updated_at2015-12-11 23:55:29.371301
descriptionRequest
homepagehttps://github.com/ghmlee/rust-request
repositoryhttps://github.com/ghmlee/rust-request.git
max_upload_size
id1831
size14,184
Graham Lee (ghmlee)

documentation

https://ghmlee.github.io/rust-request/doc/request

README

Request

Build Status

Documentation is available here.

Quick start

[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);
Commit count: 33

cargo fmt