-
Rust 的 HTTP 库:rust-http
资源介绍
Rust 的 HTTP 库
一个简单的 Rust HTTP 库。 因为学习。
extern crate http;
fn main () {
let response = match http :: get ( "http://www.google.com" ) {
Ok (resp) => resp,
_ => panic! ( "There was a problem making the request" ),
};
if response.status_code as int == 200 {
println! ( "Time according to Google: {}" , response.headers. get ( "date" ))
}
}