Request
Extends Body.
The Request class as specified by WHATWG
Note: Can only be used when processing requests, not during build-time initialization.
See also
Constructor
Properties
Returns a Headers object consisting of the headers associated with request.
Returns request's HTTP method, which is "GET" by default.
Returns the URL of request as a string.
The backend this request was sent to, or undefined for the downstream
request itself.
Fastly-specific property - determines whether a request is cacheable per conservative RFC 9111 semantics.
In particular, this function checks whether the request method is GET or HEAD, and
considers requests with other methods uncacheable. Applications where it is safe to cache
responses to other methods should consider using their own cacheability check instead of
this function.
This function always returns undefined on hosts not supporting the HTTP Cache API (i.e. Viceroy)
Methods
setCacheKey
View sourcesetCacheKey(key: string): voidSet a custom cache key for this request.
Parameters
- key: string
The cache key to use.
Returns
setCacheOverride
View sourceSet the cache override for this request.
Parameters
- override: CacheOverride
The cache override configuration to apply.
Returns
setManualFramingHeaders
View sourcesetManualFramingHeaders(manual: boolean): voidControls how framing headers (Content-Length, Transfer-Encoding) are
determined. In "manual" mode, any provided framing headers will be
honored. In "automatic" mode (the default), they are set based on the
body.
Parameters
- manual: boolean
Whether to use manual mode for framing headers.
Returns