actix-web/awc
Rob Ede 7faeffc5ab
prepare actix-test release 0.1.0-beta.3
2021-06-20 19:47:42 +01:00
..
examples
src tweak compress feature docs 2021-06-19 20:23:06 +01:00
tests
CHANGES.md
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md

README.md

awc (Actix Web Client)

Async HTTP and WebSocket client library.

crates.io Documentation MIT or Apache 2.0 licensed Dependency Status Join the chat at https://gitter.im/actix/actix-web

Documentation & Resources

Example

use actix_rt::System;
use awc::Client;

fn main() {
    System::new().block_on(async {
        let client = Client::default();

        let res = client
            .get("http://www.rust-lang.org")    // <- Create request builder
            .insert_header(("User-Agent", "Actix-web"))
            .send()                             // <- Send http request
            .await;

        println!("Response: {:?}", res);        // <- server http response
    });
}