actix-web/awc
Rob Ede eb0eda69c6
migrate cookie handling to cookie crate (#1558)
2020-06-19 14:34:14 +01:00
..
src migrate cookie handling to cookie crate (#1558) 2020-06-19 14:34:14 +01:00
tests
CHANGES.md
Cargo.toml Update `actix-http-test` dependency to 2.0.0-alpha.1 2020-05-23 12:14:17 +09:00
LICENSE-APACHE
LICENSE-MIT
README.md

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(())
          })
    }));
}