Crates.io | actoriwc |
lib.rs | actoriwc |
version | 1.0.1 |
source | src |
created_at | 2020-01-20 01:30:17.814186 |
updated_at | 2020-01-20 01:30:17.814186 |
description | Actori http client. |
homepage | https://actori.t42x.net |
repository | https://github.com/actori/actori-web.git |
max_upload_size | |
id | 200315 |
size | 144,975 |
An HTTP Client
use actori_rt::System;
use actoriwc::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", "Actori-web")
.send() // <- Send http request
.and_then(|response| { // <- server http response
println!("Response: {:?}", response);
Ok(())
})
}));
}