[][src]Crate awc

An HTTP Client

use futures::future::{lazy, Future};
use actix_rt::System;
use awc::Client;

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
          .map_err(|_| ())
          .and_then(|response| {              // <- server http response
               println!("Response: {:?}", response);
               Ok(())
          })
    }));
}

Modules

cookie

https://github.com/alexcrichton/cookie-rs fork

error

Http client errors

http

Various HTTP related types

test

Test helpers for actix http client to use during testing.

ws

Websockets client

Structs

BoxedSocket
Client

An HTTP Client

ClientBuilder

An HTTP Client builder

ClientRequest

An HTTP Client request builder

ClientResponse

Client Response

Connector

Manages http client network connectivity The Connector type uses a builder-like combinator pattern for service construction that finishes by calling the .finish() method.

JsonBody

Response's payload json parser, it resolves to a deserialized T value.

MessageBody

Future that resolves to a complete http message body.