Skip to main content

Class: RoboRequest

Extends the Web Request API with additional convenience methods.

Extends

  • Request

Properties

PropertyModifierTypeDescriptionInherited from
[INTERNALS]publicobject--
[INTERNALS].paramspublicRecord<string, string>--
[INTERNALS].rawpublicIncomingMessage--
bodyreadonlyReadableStream<Uint8Array>MDN ReferenceRequest.body
bodyUsedreadonlybooleanMDN ReferenceRequest.bodyUsed
cachereadonlyRequestCacheReturns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. MDN ReferenceRequest.cache
credentialsreadonlyRequestCredentialsReturns 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 ReferenceRequest.credentials
destinationreadonlyRequestDestinationReturns the kind of resource requested by request, e.g., "document" or "script". MDN ReferenceRequest.destination
headersreadonlyHeadersReturns 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 ReferenceRequest.headers
integrityreadonlystringReturns 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 ReferenceRequest.integrity
keepalivereadonlybooleanReturns a boolean indicating whether or not request can outlive the global in which it was created. MDN ReferenceRequest.keepalive
methodreadonlystringReturns request's HTTP method, which is "GET" by default. MDN ReferenceRequest.method
modereadonlyRequestModeReturns 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 ReferenceRequest.mode
redirectreadonlyRequestRedirectReturns 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 ReferenceRequest.redirect
referrerreadonlystringReturns 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 ReferenceRequest.referrer
referrerPolicyreadonlyReferrerPolicyReturns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. MDN ReferenceRequest.referrerPolicy
signalreadonlyAbortSignalReturns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. MDN ReferenceRequest.signal
urlreadonlystringReturns the URL of request as a string. MDN ReferenceRequest.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>

MDN Reference

Returns

Promise<ArrayBuffer>

Inherited from

Request.arrayBuffer


blob()

blob(): Promise<Blob>

MDN Reference

Returns

Promise<Blob>

Inherited from

Request.blob


clone()

clone(): Request

MDN Reference

Returns

Request

Inherited from

Request.clone


formData()

formData(): Promise<FormData>

MDN Reference

Returns

Promise<FormData>

Inherited from

Request.formData


json()

json(): Promise<any>

MDN Reference

Returns

Promise<any>

Inherited from

Request.json


text()

text(): Promise<string>

MDN Reference

Returns

Promise<string>

Inherited from

Request.text


from()

static from(req, options?): Promise<RoboRequest>

Parameters

ParameterType
reqIncomingMessage
options?FromOptions

Returns

Promise<RoboRequest>

Robo.js Logo

MIT © 2024 Robo.js By WavePlay