Request()
The Request() constructor creates a new
Request object.
Syntax
new Request(input)
new Request(input, options)
Parameters
-
input-
: Defines the resource that you wish to fetch. This can either be:
- A string containing the direct URL of the resource you want to fetch.
- A
Requestobject, effectively creating a copy.
-
-
optionsoptional-
: An object containing any custom settings that you want to apply to the request. The possible options are:
method- : The request method, e.g.,
GET,POST. The default isGET.
- : The request method, e.g.,
headers- : Any headers you want to add to your request, contained
within a
Headersobject or an object literal withStringvalues.
- : Any headers you want to add to your request, contained
within a
body- : Any body that you want to add to your request: this can be an
ArrayBuffer, aTypedArray, aDataView, aURLSearchParams, string object or literal, or aReadableStreamobject.
- : Any body that you want to add to your request: this can be an
backendFastly-specificcacheOverrideFastly-specificcacheKeyFastly-specific
-