Struct tinyget::Request[][src]

pub struct Request { /* fields omitted */ }
Expand description

An HTTP request.

Generally created by the tinyget::get-style functions, corresponding to the HTTP method we want to use.

Example

let request = tinyget::get("http://example.com");

After creating the request, you would generally call send or send_lazy on it, as it doesn’t do much on its own.

Implementations

Creates a new HTTP Request.

This is only the request’s data, it is not sent yet. For sending the request, see send.

Adds a header to the request this is called on. Use this function to add headers to your requests.

Sets the request timeout in seconds.

Sets the max redirects we follow until giving up. 100 by default.

Warning: setting this to a very high number, such as 1000, may cause a stack overflow if that many redirects are followed. If you have a use for so many redirects that the stack overflow becomes a problem, please open an issue.

Sends this request to the host.

Errors

Returns Err if we run into an error while sending the request, or receiving/parsing the response. The specific error is described in the Err, and it can be any tinyget::Error except InvalidUtf8InBody.

Sends this request to the host, loaded lazily.

Errors

See send.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.