Package-level declarations

Types

Link copied to clipboard
interface Body
Link copied to clipboard

Union of:

Link copied to clipboard
sealed interface CrossOrigin
Link copied to clipboard
sealed interface FetchPriority
Link copied to clipboard
Link copied to clipboard
open class Headers(init: ReadonlyArray<Tuple2<JsString, JsString>> = definedExternally) : MapLike.Mixin<JsString, JsString> , HeadersInit

The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class Request(val url: String, init: RequestInit = definedExternally) : Body, AbortableLike

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

Link copied to clipboard
sealed interface RequestCache
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed interface RequestMethod
Link copied to clipboard
sealed interface RequestMode
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class Response(body: BodyInit? = definedExternally, init: ResponseInit = definedExternally) : Body

The Response interface of the Fetch API represents the response to a request.

Link copied to clipboard
Link copied to clipboard
sealed interface ResponseType

Properties

Link copied to clipboard
val CrossOrigin.Companion.anonymous: CrossOrigin
Link copied to clipboard
val RequestDestination.Companion.audio: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.audioworklet: RequestDestination
Link copied to clipboard
val FetchPriority.Companion.auto: FetchPriority

val RequestPriority.Companion.auto: RequestPriority
Link copied to clipboard
val ResponseType.Companion.basic: ResponseType
Link copied to clipboard
val RequestMode.Companion.cors: RequestMode
val ResponseType.Companion.cors: ResponseType
Link copied to clipboard
val RequestCache.Companion.default: RequestCache
val ResponseType.Companion.default: ResponseType
Link copied to clipboard
val RequestMethod.Companion.DELETE: RequestMethod
Link copied to clipboard
val RequestDestination.Companion.document: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.embed: RequestDestination
Link copied to clipboard
val RequestRedirect.Companion.error: RequestRedirect
val ResponseType.Companion.error: ResponseType
Link copied to clipboard
val RequestRedirect.Companion.follow: RequestRedirect
Link copied to clipboard
val RequestDestination.Companion.font: RequestDestination
Link copied to clipboard
val RequestCache.Companion.forceCache: RequestCache
Link copied to clipboard
val RequestDestination.Companion.frame: RequestDestination
Link copied to clipboard
val RequestMethod.Companion.GET: RequestMethod
Link copied to clipboard
val RequestMethod.Companion.HEAD: RequestMethod
Link copied to clipboard
val FetchPriority.Companion.high: FetchPriority

val RequestPriority.Companion.high: RequestPriority
Link copied to clipboard
val RequestDestination.Companion.iframe: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.image: RequestDestination
Link copied to clipboard
val RequestCredentials.Companion.include: RequestCredentials
Link copied to clipboard
val RequestDestination.Companion.json: RequestDestination
Link copied to clipboard
val FetchPriority.Companion.low: FetchPriority

val RequestPriority.Companion.low: RequestPriority
Link copied to clipboard
val RequestDestination.Companion.manifest: RequestDestination
Link copied to clipboard
val RequestRedirect.Companion.manual: RequestRedirect
Link copied to clipboard
val RequestMode.Companion.navigate: RequestMode
Link copied to clipboard
val RequestCache.Companion.noCache: RequestCache
Link copied to clipboard
val RequestMode.Companion.noCors: RequestMode
Link copied to clipboard
val ReferrerPolicy.Companion.none: ReferrerPolicy
val RequestDestination.Companion.none: RequestDestination
Link copied to clipboard
val ReferrerPolicy.Companion.noReferrer: ReferrerPolicy
Link copied to clipboard
Link copied to clipboard
val RequestCache.Companion.noStore: RequestCache
Link copied to clipboard
val RequestDestination.Companion.object: RequestDestination
Link copied to clipboard
val RequestCredentials.Companion.omit: RequestCredentials
Link copied to clipboard
val RequestCache.Companion.onlyIfCached: RequestCache
Link copied to clipboard
val ResponseType.Companion.opaque: ResponseType
Link copied to clipboard
val ResponseType.Companion.opaqueredirect: ResponseType
Link copied to clipboard
val RequestMethod.Companion.OPTIONS: RequestMethod
Link copied to clipboard
val ReferrerPolicy.Companion.origin: ReferrerPolicy
Link copied to clipboard
Link copied to clipboard
val RequestDestination.Companion.paintworklet: RequestDestination
Link copied to clipboard
val RequestMethod.Companion.PATCH: RequestMethod
Link copied to clipboard
val RequestMethod.Companion.POST: RequestMethod
Link copied to clipboard
val RequestMethod.Companion.PUT: RequestMethod
Link copied to clipboard
val RequestCache.Companion.reload: RequestCache
Link copied to clipboard
val RequestDestination.Companion.report: RequestDestination
Link copied to clipboard
val ReferrerPolicy.Companion.sameOrigin: ReferrerPolicy
val RequestCredentials.Companion.sameOrigin: RequestCredentials
val RequestMode.Companion.sameOrigin: RequestMode
Link copied to clipboard
val RequestDestination.Companion.script: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.sharedworker: RequestDestination
Link copied to clipboard
val ReferrerPolicy.Companion.strictOrigin: ReferrerPolicy
Link copied to clipboard
Link copied to clipboard
val RequestDestination.Companion.style: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.track: RequestDestination
Link copied to clipboard
val ReferrerPolicy.Companion.unsafeUrl: ReferrerPolicy
Link copied to clipboard
val CrossOrigin.Companion.useCredentials: CrossOrigin
Link copied to clipboard
val RequestDestination.Companion.video: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.worker: RequestDestination
Link copied to clipboard
val RequestDestination.Companion.xslt: RequestDestination

Functions

Link copied to clipboard
inline suspend fun Body.arrayBuffer(): ArrayBuffer

The arrayBuffer() method of the Request interface reads the request body and returns it as a promise that resolves with an ArrayBuffer.

Link copied to clipboard
inline suspend fun Body.blob(): Blob

The blob() method of the Request interface reads the request body and returns it as a promise that resolves with a Blob.

Link copied to clipboard
inline fun BodyInit(value: BufferSource): BodyInit
inline fun BodyInit(value: String): BodyInit
Link copied to clipboard
suspend fun Body.byteArray(): ByteArray
Link copied to clipboard
inline suspend fun Body.bytes(): Uint8Array<ArrayBuffer>

The bytes() method of the Request interface reads the request body and returns it as a promise that resolves with a Uint8Array.

Link copied to clipboard
suspend fun fetch(url: String): FetchResult
suspend fun fetch(request: Request): FetchResult
suspend fun fetch(url: URLLike): FetchResult
suspend fun fetch(url: String, init: RequestInit): FetchResult
suspend fun fetch(request: Request, init: RequestInit): FetchResult
suspend fun fetch(url: URLLike, init: RequestInit): FetchResult
Link copied to clipboard
external fun fetchAsync(url: String, init: RequestInit? = definedExternally): Promise<Response>
external fun fetchAsync(request: Request, init: RequestInit? = definedExternally): Promise<Response>
external fun fetchAsync(url: URLLike, init: RequestInit? = definedExternally): Promise<Response>
Link copied to clipboard
inline suspend fun Body.formData(): FormData

The formData() method of the Request interface reads the request body and returns it as a promise that resolves with a FormData object.

Link copied to clipboard
inline fun HeadersInit(value: ReadonlyArray<Tuple2<JsString, JsString>>): HeadersInit
inline fun HeadersInit(value: ReadonlyRecord<JsString, JsString>): HeadersInit
Link copied to clipboard
inline suspend fun Body.json(): JsAny?

The json() method of the Request interface reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON.

Link copied to clipboard
inline suspend fun Body.text(): String

The text() method of the Request interface reads the request body and returns it as a promise that resolves with a String. The response is always decoded using UTF-8.