Request
The Request() constructor creates a new Request object.
new Request(input);new Request(input, options);Parameters
-
inputDefines the resource you wish to fetch. Can be one of the following:
- A string containing the resource you wish to fetch.
Requestobject, effectively creating a copy.
-
options(optional)An options object containing any other data to associate with the Request
-
method: (optional)
e.g.
GET,POST,PUT,DELETE. (Default isGET) -
headers: (optional)
An object: containing either a
Headersobject or object literal withStringkey/value pairs. -
body: (optional)
Any body that you want to add to your request: this can be an
ArrayBuffer, aTypedArray, aDataView, aURLSearchParams, string object or literal, or aReadableStreamobject.
-