[][src]Crate scrappy_client

An HTTP Client

use futures::future::{lazy, Future};
use scrappy_rt::System;
use scrappy_client::Client;

#[scrappy_rt::main]
async fn main() {
   let mut client = Client::default();

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

    println!("Response: {:?}", response);
}

Modules

cookie

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

error

Http client errors

http

Various HTTP related types

test

Test helpers for scrappy 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.

FrozenClientRequest

FrozenClientRequest struct represents clonable client request. It could be used to send same request multiple times.

FrozenSendBuilder

Builder that allows to modify extra headers.

JsonBody

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

MessageBody

Future that resolves to a complete http message body.

Enums

SendClientRequest

Future that sends request's payload and resolves to a server response.