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

Expand description

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

Http client errors

Websockets client

Structs

An HTTP Client

An HTTP Client builder

An HTTP Client request builder

Client Response

Manages http client network connectivity.

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

Builder that allows to modify extra headers.

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

Future that resolves to a complete http message body.

Test ClientResponse builder

Enums

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

Traits