Request

open class Request(val url: String, init: RequestInit = definedExternally) : Body, AbortableLike(source)

The Request interface of the Fetch API represents a resource request.

MDN Reference

Constructors

Link copied to clipboard
constructor(url: String, init: RequestInit = definedExternally)
constructor(url: URL, init: RequestInit = definedExternally)
constructor(request: Request, init: RequestInit = definedExternally)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The cache read-only property of the Request interface contains the cache mode of the request.

Link copied to clipboard

The credentials read-only property of the Request interface reflects the value given to the Request.Request() constructor in the credentials option.

Link copied to clipboard

The destination read-only property of the Request interface returns a string describing the type of content being requested.

Link copied to clipboard

The headers read-only property of the Request interface contains the Headers object associated with the request.

Link copied to clipboard

The integrity read-only property of the Request interface contains the subresource integrity value of the request.

Link copied to clipboard

The keepalive read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.

Link copied to clipboard

The method read-only property of the Request interface contains the request's method (GET, POST, etc.)

Link copied to clipboard

The mode read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable.

Link copied to clipboard

The redirect read-only property of the Request interface contains the mode for how redirects are handled.

Link copied to clipboard

The referrer read-only property of the Request interface is set by the user agent to be the referrer of the Request.

Link copied to clipboard

The referrerPolicy read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request.

Link copied to clipboard
open override val signal: AbortSignal

The read-only signal property of the Request interface returns the AbortSignal associated with the request.

Link copied to clipboard
val url: String

The url read-only property of the Request interface contains the URL of the request.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline suspend fun Body.blob(): Blob
Link copied to clipboard
Link copied to clipboard
suspend fun Body.byteArray(): ByteArray
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun clone(): Request

The clone() method of the Request interface creates a copy of the current Request object.

Link copied to clipboard
inline suspend fun Body.formData(): FormData
Link copied to clipboard
Link copied to clipboard
inline suspend fun Body.json(): JsAny?
Link copied to clipboard
Link copied to clipboard
inline suspend fun Body.text(): String
Link copied to clipboard