Response

open class Response(body: BodyInit? = definedExternally, init: ResponseInit = definedExternally) : Body(source)

The Response interface of the Fetch API represents the response to a request.

MDN Reference

Constructors

Link copied to clipboard
constructor(body: BodyInit? = definedExternally, init: ResponseInit = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The headers read-only property of the with the response.

Link copied to clipboard
val ok: Boolean

The ok read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.

Link copied to clipboard

The redirected read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected.

Link copied to clipboard

The status read-only property of the Response interface contains the HTTP status codes of the response.

Link copied to clipboard

The statusText read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status.

Link copied to clipboard

The type read-only property of the Response interface contains the type of the response.

Link copied to clipboard
val url: String

The url read-only property of the Response interface contains the URL of the response.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open suspend fun blob(): Blob
Link copied to clipboard
open fun blobAsync(): Promise<Blob>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The clone() method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.

Link copied to clipboard
open suspend fun formData(): FormData
Link copied to clipboard
Link copied to clipboard
open suspend fun json(): JsAny?
Link copied to clipboard
open fun jsonAsync(): Promise<*>
Link copied to clipboard
open suspend fun text(): String
Link copied to clipboard