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<Tuple2<JsString, JsString>> = definedExternally) : MapLike<JsString, JsString>

The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers.

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

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

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>