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
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Request
impl UnwindSafe for Request
Blanket Implementations
Mutably borrows from an owned value. Read more