Class: RoboRequest
Extends the Web Request API with additional convenience methods.
Extends
Request
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
[INTERNALS] | public | object | - | - |
[INTERNALS].params | public | Record <string , string > | - | - |
[INTERNALS].raw | public | IncomingMessage | - | - |
body | readonly | ReadableStream <Uint8Array > | MDN Reference | Request.body |
bodyUsed | readonly | boolean | MDN Reference | Request.bodyUsed |
cache | readonly | RequestCache | Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. MDN Reference | Request.cache |
credentials | readonly | RequestCredentials | Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. MDN Reference | Request.credentials |
destination | readonly | RequestDestination | Returns the kind of resource requested by request, e.g., "document" or "script". MDN Reference | Request.destination |
headers | readonly | Headers | Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header. MDN Reference | Request.headers |
integrity | readonly | string | Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI] MDN Reference | Request.integrity |
keepalive | readonly | boolean | Returns a boolean indicating whether or not request can outlive the global in which it was created. MDN Reference | Request.keepalive |
method | readonly | string | Returns request's HTTP method, which is "GET" by default. MDN Reference | Request.method |
mode | readonly | RequestMode | Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. MDN Reference | Request.mode |
redirect | readonly | RequestRedirect | Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. MDN Reference | Request.redirect |
referrer | readonly | string | Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the Referer header of the request being made. MDN Reference | Request.referrer |
referrerPolicy | readonly | ReferrerPolicy | Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. MDN Reference | Request.referrerPolicy |
signal | readonly | AbortSignal | Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. MDN Reference | Request.signal |
url | readonly | string | Returns the URL of request as a string. MDN Reference | Request.url |
Accessors
params
Get Signature
get params(): Record<string, string>
Returns
Record
<string
, string
>
query
Get Signature
get query(): Record<string, string | string[]>
Returns
Record
<string
, string
| string
[]>
raw
Get Signature
get raw(): IncomingMessage
Returns
IncomingMessage
Methods
arrayBuffer()
arrayBuffer(): Promise<ArrayBuffer>
Returns
Promise
<ArrayBuffer
>
Inherited from
Request.arrayBuffer
blob()
blob(): Promise<Blob>
Returns
Promise
<Blob
>
Inherited from
Request.blob
clone()
clone(): Request
Returns
Request
Inherited from
Request.clone
formData()
formData(): Promise<FormData>
Returns
Promise
<FormData
>
Inherited from
Request.formData
json()
json(): Promise<any>
Returns
Promise
<any
>
Inherited from
Request.json
text()
text(): Promise<string>
Returns
Promise
<string
>
Inherited from
Request.text
from()
static from(req, options?): Promise<RoboRequest>
Parameters
Parameter | Type |
---|---|
req | IncomingMessage |
options ? | FromOptions |
Returns
Promise
<RoboRequest
>