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

use new actix system api

This commit is contained in:
Nikolay Kim
2018-05-29 10:31:37 -07:00
parent fb582a6bca
commit ecd05662c0
13 changed files with 173 additions and 165 deletions

View File

@@ -24,7 +24,7 @@ use httprequest::HttpRequest;
/// An HTTP Client Request
///
/// ```rust
/// ```rust,ignore
/// # extern crate actix;
/// # extern crate actix_web;
/// # extern crate futures;
@@ -32,22 +32,17 @@ use httprequest::HttpRequest;
/// use actix_web::client::ClientRequest;
///
/// fn main() {
/// let sys = actix::System::new("test");
///
/// actix::Arbiter::spawn({
/// tokio::run(
/// 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
/// .and_then(|response| { // <- server http response
/// println!("Response: {:?}", response);
/// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
/// Ok(())
/// })
/// });
///
/// sys.run();
/// );
/// }
/// ```
pub struct ClientRequest {