[][src]Module ntex::http::client

HTTP Client

use futures::future::{lazy, Future};
use ntex::http::client::Client;

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

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

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

Modules

error

Http client errors

ws

Websockets client

Structs

BoxedSocket
Client

An HTTP Client

ClientBuilder

An HTTP Client builder

ClientRequest

An HTTP Client request builder

ClientResponse

Client Response

Connect
Connector

Manages http client network connectivity.

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.

TestResponse

Test ClientResponse builder

Enums

SendClientRequest

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

Traits

Connection