Crates.io | requiem-wc |
lib.rs | requiem-wc |
version | 1.0.1-r1 |
source | src |
created_at | 2020-01-18 02:26:29.469475 |
updated_at | 2020-01-18 20:58:15.894 |
description | Actix http client. |
homepage | https://actix.rs |
repository | https://github.com/actix/actix-web.git |
max_upload_size | |
id | 199625 |
size | 145,261 |
An HTTP Client
use requiem_rt::System;
use requiem_wc::Client;
use futures::future::{Future, lazy};
fn main() {
System::new("test").block_on(lazy(|| {
let mut client = Client::default();
client.get("http://www.rust-lang.org") // <- Create request builder
.header("User-Agent", "Actix-web")
.send() // <- Send http request
.and_then(|response| { // <- server http response
println!("Response: {:?}", response);
Ok(())
})
}));
}