pub struct Request { /* private fields */ }
This is supported on crate feature http only.
Expand description

A wrapper round web_sys::Request: an http request to be used with the fetch API.

Implementations

Creates a new request that will be sent to url.

Uses GET by default. url can be a String, a &str, or a Cow<'a, str>.

Set the body for this request.

A string indicating how the request will interact with the browser’s HTTP cache.

Controls what browsers do with credentials (cookies, HTTP authentication entries, and TLS client certificates).

Replace all the headers.

Sets a header.

The subresource integrity value of the request (e.g., sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=).

The request method, e.g., GET, POST.

Note that the Origin header is not set on Fetch requests with a method of HEAD or GET.

The mode you want to use for the request.

Sets the observer callback.

How to handle a redirect response:

  • follow: Automatically follow redirects. Unless otherwise stated the redirect mode is set to follow
  • error: Abort with an error if a redirect occurs.
  • manual: Caller intends to process the response in another context. See WHATWG fetch standard for more information.

The referrer of the request.

This can be a same-origin URL, about:client, or an empty string.

Specifies the referrer policy to use for the request.

Sets the request abort signal.

Executes the request.

Creates a new GET Request with url.

Creates a new POST Request with url.

Creates a new PUT Request with url.

Creates a new DELETE Request with url.

Creates a new PATCH Request with url.

Trait Implementations

Formats the value using the given formatter. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.