1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-22 08:07:18 +00:00
actix-web/awc
2019-09-12 21:58:08 +06:00
..
src fmt & clippy 2019-09-12 21:52:46 +06:00
tests add rustls support for actix-http and awc (#998) 2019-07-31 13:02:56 -07:00
Cargo.toml prepare releases 2019-09-12 21:58:08 +06:00
CHANGES.md export frozen request related types; refactor code layout 2019-09-12 10:40:56 +06:00
LICENSE-APACHE
LICENSE-MIT
README.md

Actix http client Build Status codecov crates.io Join the chat at https://gitter.im/actix/actix

An HTTP Client

Documentation & community resources

Example

use actix_rt::System;
use awc::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(())
          })
    }));
}