Response

open external class Response : Body (source)

Platform and version requirements: JS

Exposes the JavaScript Response to Kotlin

Constructors

<init>

Response(
    body: dynamic = definedExternally,
    init: ResponseInit = definedExternally)

Exposes the JavaScript Response to Kotlin

Properties

body

open val body: dynamic

bodyUsed

open val bodyUsed: Boolean

headers

open val headers: Headers

ok

open val ok: Boolean

redirected

open val redirected: Boolean

status

open val status: Short

statusText

open val statusText: String

trailer

open val trailer: Promise<Headers>

type

open val type: ResponseType

url

open val url: String

Functions

arrayBuffer

open fun arrayBuffer(): Promise<ArrayBuffer>

blob

open fun blob(): Promise<Blob>

clone

fun clone(): Response

formData

open fun formData(): Promise<FormData>

json

open fun json(): Promise<Any?>

text

open fun text(): Promise<String>

Companion Object Functions

error

fun error(): Response

redirect

fun redirect(
    url: String,
    status: Short = definedExternally
): Response