[−][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 |
| FrozenClientRequest |
|
| FrozenSendBuilder | Builder that allows to modify extra headers. |
| JsonBody | Response's payload json parser, it resolves to a deserialized |
| MessageBody | Future that resolves to a complete http message body. |
Enums
| SendClientRequest | Future that sends request's payload and resolves to a server response. |