Package-level declarations

Types

Link copied to clipboard
sealed external interface Body
Link copied to clipboard
sealed external interface BodyInit
Link copied to clipboard
sealed external interface CrossOrigin
Link copied to clipboard
sealed external interface FetchPriority
Link copied to clipboard
open external class Headers(init: ReadonlyArray<JsTuple2<String, String>> = definedExternally) : MapLike<String, String>

This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.

Link copied to clipboard
sealed external interface ReferrerPolicy
Link copied to clipboard
open external class Request(input: Request, init: RequestInit = definedExternally) : Body

This Fetch API interface represents a resource request.

Link copied to clipboard
sealed external interface RequestCache
Link copied to clipboard
sealed external interface RequestCredentials
Link copied to clipboard
sealed external interface RequestDestination
Link copied to clipboard
external interface RequestInit : Abortable
Link copied to clipboard
sealed external interface RequestMethod
Link copied to clipboard
sealed external interface RequestMode
Link copied to clipboard
sealed external interface RequestPriority
Link copied to clipboard
sealed external interface RequestRedirect
Link copied to clipboard
open external class Response(body: BodyInit? = definedExternally, init: ResponseInit = definedExternally) : Body

This Fetch API interface represents the response to a request.

Link copied to clipboard
external interface ResponseInit
Link copied to clipboard
sealed external interface ResponseType

Functions

Link copied to clipboard
inline fun BodyInit(value: BufferSource): BodyInit
inline fun BodyInit(value: String): BodyInit
inline fun BodyInit(value: Blob): BodyInit
inline fun BodyInit(value: FormData): BodyInit
inline fun BodyInit(value: ReadableStream<*>): BodyInit
inline fun BodyInit(value: URLSearchParams): BodyInit
Link copied to clipboard
suspend fun fetch(input: String): Response
suspend fun fetch(input: Request): Response
suspend fun fetch(input: URL): Response
suspend fun fetch(input: String, init: RequestInit): Response
suspend fun fetch(input: Request, init: RequestInit): Response
suspend fun fetch(input: URL, init: RequestInit): Response
Link copied to clipboard
external fun fetchAsync(input: String, init: RequestInit? = definedExternally): Promise<Response>
external fun fetchAsync(input: URL, init: RequestInit? = definedExternally): Promise<Response>

external fun fetchAsync(input: Request, init: RequestInit? = definedExternally): Promise<Response>