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
open class Headers(init: ReadonlyArray<Tuple2<ERROR CLASS: Symbol not found for JsString, ERROR CLASS: Symbol not found for JsString>> = definedExternally) : MapLike<ERROR CLASS: Symbol not found for JsString, ERROR CLASS: Symbol not found for 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
sealed interface ReferrerPolicy
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
sealed interface RequestCredentials
Link copied to clipboard
sealed interface RequestDestination
Link copied to clipboard
Link copied to clipboard
sealed interface RequestMethod
Link copied to clipboard
sealed interface RequestMode
Link copied to clipboard
sealed interface RequestPriority
Link copied to clipboard
sealed interface RequestRedirect
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
interface ResponseInit
Link copied to clipboard
sealed interface ResponseType

Properties

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

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): Response
suspend fun fetch(request: Request): Response
suspend fun fetch(url: URL): Response
suspend fun fetch(url: String, init: RequestInit): Response
suspend fun fetch(request: Request, init: RequestInit): Response
suspend fun fetch(url: URL, init: RequestInit): Response
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: URL, 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<ERROR CLASS: Symbol not found for JsString, ERROR CLASS: Symbol not found for JsString>>): HeadersInit
inline fun HeadersInit(value: ReadonlyRecord<ERROR CLASS: Symbol not found for JsString, ERROR CLASS: Symbol not found for JsString>): HeadersInit
Link copied to clipboard
inline suspend fun Body.json(): ERROR CLASS: Symbol not found for 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.