Package org.w3c.fetch

Platform and version requirements: JS

Kotlin JavaScript wrappers for the W3C fetch API.

Types

Body

external interface Body

Exposes the JavaScript Body to Kotlin

Headers

open external class Headers

Exposes the JavaScript Headers to Kotlin

Request

open external class Request : Body

Exposes the JavaScript Request to Kotlin

RequestCache

external interface RequestCache

RequestCredentials

external interface RequestCredentials

RequestDestination

external interface RequestDestination

RequestInit

external interface RequestInit

RequestMode

external interface RequestMode

RequestRedirect

external interface RequestRedirect

RequestType

external interface RequestType

Response

open external class Response : Body

Exposes the JavaScript Response to Kotlin

ResponseInit

external interface ResponseInit

ResponseType

external interface ResponseType

Functions

RequestInit

fun RequestInit(
    method: String? = null,
    headers: dynamic = null,
    body: dynamic = null,
    referrer: String? = null,
    referrerPolicy: dynamic = null,
    mode: RequestMode? = null,
    credentials: RequestCredentials? = null,
    cache: RequestCache? = null,
    redirect: RequestRedirect? = null,
    integrity: String? = null,
    keepalive: Boolean? = null,
    window: Any? = null
): RequestInit

ResponseInit

fun ResponseInit(
    status: Short? = 200,
    statusText: String? = "OK",
    headers: dynamic = null
): ResponseInit

Companion Object Properties

AUDIO

val RequestType.Companion.AUDIO: RequestType

BASIC

val ResponseType.Companion.BASIC: ResponseType

CORS

val RequestMode.Companion.CORS: RequestMode
val ResponseType.Companion.CORS: ResponseType

DEFAULT

val RequestCache.Companion.DEFAULT: RequestCache
val ResponseType.Companion.DEFAULT: ResponseType

DOCUMENT

val RequestDestination.Companion.DOCUMENT: RequestDestination

EMBED

val RequestDestination.Companion.EMBED: RequestDestination

EMPTY

val RequestType.Companion.EMPTY: RequestType
val RequestDestination.Companion.EMPTY: RequestDestination

ERROR

val RequestRedirect.Companion.ERROR: RequestRedirect
val ResponseType.Companion.ERROR: ResponseType

FOLLOW

val RequestRedirect.Companion.FOLLOW: RequestRedirect

FONT

val RequestType.Companion.FONT: RequestType
val RequestDestination.Companion.FONT: RequestDestination

FORCE_CACHE

val RequestCache.Companion.FORCE_CACHE: RequestCache

IMAGE

val RequestType.Companion.IMAGE: RequestType
val RequestDestination.Companion.IMAGE: RequestDestination

INCLUDE

val RequestCredentials.Companion.INCLUDE: RequestCredentials

MANIFEST

val RequestDestination.Companion.MANIFEST: RequestDestination

MANUAL

val RequestRedirect.Companion.MANUAL: RequestRedirect

MEDIA

val RequestDestination.Companion.MEDIA: RequestDestination

NAVIGATE

val RequestMode.Companion.NAVIGATE: RequestMode

NO_CACHE

val RequestCache.Companion.NO_CACHE: RequestCache

NO_CORS

val RequestMode.Companion.NO_CORS: RequestMode

NO_STORE

val RequestCache.Companion.NO_STORE: RequestCache

OBJECT

val RequestDestination.Companion.OBJECT: RequestDestination

OMIT

val RequestCredentials.Companion.OMIT: RequestCredentials

ONLY_IF_CACHED

val RequestCache.Companion.ONLY_IF_CACHED: RequestCache

OPAQUE

val ResponseType.Companion.OPAQUE: ResponseType

OPAQUEREDIRECT

val ResponseType.Companion.OPAQUEREDIRECT: ResponseType

RELOAD

val RequestCache.Companion.RELOAD: RequestCache

REPORT

val RequestDestination.Companion.REPORT: RequestDestination

SAME_ORIGIN

val RequestMode.Companion.SAME_ORIGIN: RequestMode
val RequestCredentials.Companion.SAME_ORIGIN: RequestCredentials

SCRIPT

val RequestType.Companion.SCRIPT: RequestType
val RequestDestination.Companion.SCRIPT: RequestDestination

SERVICEWORKER

val RequestDestination.Companion.SERVICEWORKER: RequestDestination

SHAREDWORKER

val RequestDestination.Companion.SHAREDWORKER: RequestDestination

STYLE

val RequestType.Companion.STYLE: RequestType
val RequestDestination.Companion.STYLE: RequestDestination

TRACK

val RequestType.Companion.TRACK: RequestType

VIDEO

val RequestType.Companion.VIDEO: RequestType

WORKER

val RequestDestination.Companion.WORKER: RequestDestination

XSLT

val RequestDestination.Companion.XSLT: RequestDestination