1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 01:31:57 +02:00

better doc api examples

This commit is contained in:
Nikolay Kim
2018-06-19 12:07:07 +06:00
parent 247e8727cb
commit 5c42b0902f
5 changed files with 21 additions and 23 deletions

View File

@@ -31,19 +31,18 @@ use httprequest::HttpRequest;
/// # extern crate tokio;
/// # use futures::Future;
/// # use std::process;
/// use actix_web::client::ClientRequest;
/// use actix_web::{actix, client};
///
/// fn main() {
/// let mut sys = actix_web::actix::System::new("test");
///
/// sys.block_on(
/// ClientRequest::get("http://www.rust-lang.org") // <- Create request builder
/// actix::run(
/// || client::ClientRequest::get("http://www.rust-lang.org") // <- Create request builder
/// .header("User-Agent", "Actix-web")
/// .finish().unwrap()
/// .send() // <- Send http request
/// .map_err(|_| ())
/// .and_then(|response| { // <- server http response
/// println!("Response: {:?}", response);
/// # actix::System::current().stop();
/// Ok(())
/// }),
/// );