FetchRequest
Fetch: Request.
Specifies the interface defined by the Fetch API Specification, "Request," which represents an HTTP request created or received by the JavaScript runtime. Fetch requests model regular HTTP concepts such as the HTTP method, path, and parameters, augmenting with structure from classes like FetchHeaders and URLSearchParams.
From MDN: "The Request interface of the Fetch API represents a resource request. You can create a new Request object using the Request()
constructor, but you are more likely to encounter a Request object being returned as the result of another API operation, such as a service worker FetchEvent.request
."
Use as execution inputs
FetchRequest-shaped objects may be used with VM execution inputs in order to invoke a guest VM interface each time a request is received ("server-style invocation"). There are multiple implementations of FetchRequest from a server perspective.
Use from a guest context
Fetch requests can be created in applicable guest VM environments, such as JavaScript via the Request(...)
constructor, available globally. An instantiated Request
can then be passed to fetch
to initiate an HTTP request (host permissions permitting).
Inheritors
Types
Default values applied to FetchRequest interfaces.
Properties
Specifies, if any, a ReadableStream which holds the body of a FetchRequest. Body data may only be provided when the method for the request allows a body, such as POST
, PUT
, and so forth.
Specifies whether user credentials should be sent with the request. The default value is omit
, which indicates that user credentials (or any other credentials) should be omitted. Server-side, there are no "default" rules for authorization material present on a request; what you send is what is sent, so this property does nothing.
Describes the destination or use profile for the fetched data in a given fetch request/response cycle.
Provides a typed view of fetch headers on top of this request, via FetchHeaders, which behaves as a specialized JavaScript-compatible multi-map. Multiple header values can be set per header key, if desired, which can be safely combined into a comma-separated header value group upon render.
Indicates the referrer-policy which is active for this request. Typically not used server-side.