Struct mio_httpc::CallBuilder [] [src]

pub struct CallBuilder { /* fields omitted */ }

Used to start a call and get a Call for it.

Methods

impl CallBuilder
[src]

CallBuilder constructs a call. It is finished after calling: exec, simple_call, call or websocket.

Headers set automatically if not set manually: user-agent, connection, host, auth, content-length

If you're only executing a one-off call you should set connection: close as default is keep-alive.

If you do not set body, but do set content-length, it will wait for send body to be provided through Httpc::call_send. You must use a streaming interface in this case and can not use SimpleCall.

[src]

[src]

Start a GET request.

[src]

Start a POST request.

[src]

Start a PUT request.

[src]

Start a DELETE request.

[src]

Start an OPTIONS request.

[src]

Start a HEAD request.

[src]

Set method: "GET", "POST", "PUT", "OPTIONS", "DELETE" or "HEAD"

[src]

Default: http Use https for call. Shorthand for set_https(true)

[src]

Default: false Use https for call.

[src]

Set host where to connect to. It can be a domain or IP address.

[src]

Set connection port.

[src]

Use http authentication with username and password.

[src]

Set full path. No procent encoding is done. Will fail later if it contains invalid characters.

[src]

Add a single segment of path. Parts are delimited by / which are added automatically. Any path unsafe characters are procent encoded. If part contains /, it will be procent encoded!

[src]

Add multiple segments in one go.

[src]

Add a key-value pair to query. Any url unsafe characters are procent encoded.

[src]

Add multiple keu-value pars in one go.

[src]

Set full URL. If not valid it will return error. Be mindful of characters that need to be procent encoded. Using https, path_segm, query and auth functions to construct URL is much safer as those encode data automatically.

[src]

Set body.

[src]

Set HTTP header.

[src]

Execute directly. This will block until completion!

[src]

Consume and execute HTTP call. Returns SimpleCall interface. CallBuilder is invalid after this call and will panic if used again.

[src]

Consume and execute HTTP call. Return low level streaming call interface. CallBuilder is invalid after this call and will panic if used again.

[src]

Consume and start a WebSocket CallBuilder is invalid after this call and will panic if used again.

[src]

Default 10MB.

This will limit how big the internal Vec can grow. HTTP response headers are always stored in internal buffer. HTTP response body is stored in internal buffer if no external buffer is provided.

For WebSockets this will also be a received fragment size limit!

[src]

Default: 100ms

Starting point of dns packet resends if nothing received. Every next resend timeout is 2x the previous one but stops at 1s. Make sure to call Httpc::timeout! So for 100ms: 100ms, 200ms, 400ms, 800ms, 1000ms, 1000ms...

[src]

Default true.

Configurable because it entails copying the data stream.

[src]

Default 32K

Max size of chunk in a chunked transfer.

[src]

Default 60s

Maximum amount of time a call should last. Make sure to call Httpc::timeout!

[src]

Default 4.

How many redirects to follow. 0 to disable following redirects.

[src]

Tell server to gzip response and unzip transparently before returning body to client. Default is true.

[src]

Default secure.

Turn off domain verification over ssl. This should only be used when testing as you are throwing away a big part of ssl security.

[src]

Use digest authentication. If you know server is using digest auth you REALLY should set it to true. If server is using basic authentication and you set digest_auth to true, mio_httpc will retry with basic. If not set, basic auth is assumed which is very insecure.

[src]

Return constructed URL.

Trait Implementations

impl Debug for CallBuilder
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for CallBuilder
[src]

[src]

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

Auto Trait Implementations

impl Send for CallBuilder

impl Sync for CallBuilder