Struct actix_web::client::ClientRequestBuilder [] [src]

pub struct ClientRequestBuilder { /* fields omitted */ }

An HTTP Client request builder

This type can be used to construct an instance of ClientRequest through a builder-like pattern.

Methods

impl ClientRequestBuilder
[src]

Important traits for &'a mut W
[src]

Set HTTP URI of request.

Important traits for &'a mut W
[src]

Set HTTP method of this request.

[src]

Set HTTP method of this request.

Important traits for &'a mut W
[src]

Set HTTP version of this request.

By default requests's HTTP version depends on network stream

Important traits for &'a mut W
[src]

Append a header.

Header gets appended to existing header. To override header use set_header() method.

use http::header;

fn main() {
    let req = ClientRequest::build()
        .header("X-TEST", "value")
        .header(header::CONTENT_TYPE, "application/json")
        .finish().unwrap();
}

Important traits for &'a mut W
[src]

Set a header.

Important traits for &'a mut W
[src]

Set content encoding.

By default ContentEncoding::Identity is used.

Important traits for &'a mut W
[src]

Enables automatic chunked transfer encoding

Important traits for &'a mut W
[src]

Enable connection upgrade

Important traits for &'a mut W
[src]

Set request's content type

Important traits for &'a mut W
[src]

Set content length

Important traits for &'a mut W
[src]

Set a cookie

use actix_web::{client, http};

fn main() {
    let req = client::ClientRequest::build()
        .cookie(
            http::Cookie::build("name", "value")
                .domain("www.rust-lang.org")
                .path("/")
                .secure(true)
                .http_only(true)
                .finish())
        .finish().unwrap();
}

Important traits for &'a mut W
[src]

Do not add default request headers. By default Accept-Encoding header is set.

Important traits for &'a mut W
[src]

Disable automatic decompress response body

Important traits for &'a mut W
[src]

Set write buffer capacity

Default buffer capacity is 32kb

Important traits for &'a mut W
[src]

Set request timeout

Request timeout is a total time before response should be received. Default value is 5 seconds.

Important traits for &'a mut W
[src]

Send request using custom connector

Important traits for &'a mut W
[src]

Send request using existing Connection

Important traits for &'a mut W
[src]

This method calls provided closure with builder reference if value is true.

Important traits for &'a mut W
[src]

This method calls provided closure with builder reference if value is Some.

[src]

Set a body and generate ClientRequest.

ClientRequestBuilder can not be used after this call.

[src]

Set a JSON body and generate ClientRequest

ClientRequestBuilder can not be used after this call.

[src]

Set a streaming body and generate ClientRequest.

ClientRequestBuilder can not be used after this call.

[src]

Set an empty body and generate ClientRequest

ClientRequestBuilder can not be used after this call.

[src]

This method construct new ClientRequestBuilder

Trait Implementations

impl Debug for ClientRequestBuilder
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, S: 'static> From<&'a HttpRequest<S>> for ClientRequestBuilder
[src]

Create ClientRequestBuilder from HttpRequest

It is useful for proxy requests. This implementation copies all request headers and the method.

[src]

Performs the conversion.

Auto Trait Implementations