Struct actix_web::client::ClientRequest[][src]

pub struct ClientRequest { /* fields omitted */ }
[]

An HTTP Client Request

use actix_web::{actix, client};

fn main() {
    actix::run(
        || client::ClientRequest::get("http://www.rust-lang.org") // <- Create request builder
            .header("User-Agent", "Actix-web")
            .finish().unwrap()
            .send()                                    // <- Send http request
            .map_err(|_| ())
            .and_then(|response| {                     // <- server http response
                println!("Response: {:?}", response);
                Ok(())
            }),
    );
}

Methods

impl ClientRequest
[src]
[]

[]

Create request builder for GET request

[]

Create request builder for HEAD request

[]

Create request builder for POST request

[]

Create request builder for PUT request

[]

Create request builder for DELETE request

impl ClientRequest
[src]
[]

[]

Create client request builder

[]

Create client request builder

[]

Get the request URI

[]

Set client request URI

[]

Get the request method

[]

Set HTTP Method for the request

[]

Get HTTP version for the request

[]

Set http Version for the request

[]

Get the headers from the request

[]

Get a mutable reference to the headers

[]

is chunked encoding enabled

[]

is upgrade request

[]

Content encoding

[]

Decompress response payload

[]

Requested write buffer capacity

[]

Get body of this response

[]

Set a body

[]

Send request

This method returns a future that resolves to a ClientResponse

Trait Implementations

impl Default for ClientRequest
[src]
[+]

[]

Returns the "default value" for a type. Read more

impl Debug for ClientRequest
[src]
[+]

[]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for ClientRequest

impl !Sync for ClientRequest