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

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

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T