Package-level declarations

Types

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

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 interface ReferrerPolicy
Link copied to clipboard
open class Request(val url: String, init: RequestInit = definedExternally) : Body

This Fetch API interface 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

This Fetch API interface represents the response to a request.

Link copied to clipboard
interface ResponseInit
Link copied to clipboard
sealed 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(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>