Response

open class Response(response: Response, request: Request, propagate: Boolean)

Represents the common fields and attributes of an HTTP response. It contains also the original Request which was made to get this Response.

Constructors

Response
Link copied to clipboard
js
fun Response(response: Response, request: Request, propagate: Boolean = true)

Functions

arrayBuffer
Link copied to clipboard
js
suspend fun arrayBuffer(): ArrayBuffer
extracts the body as arrayBuffer from the given Response
blob
Link copied to clipboard
js
suspend fun blob(): Blob
extracts the body as blob from the given Response
body
Link copied to clipboard
js
suspend fun body(): String
extracts the body as string from the given Response
copy
Link copied to clipboard
js
fun copy(response: Response = this.response, request: Request = this.request, propagate: Boolean = this.propagate): Response
formData
Link copied to clipboard
js
suspend fun formData(): FormData
extracts the body as formData from the given Response
json
Link copied to clipboard
js
suspend fun json(): Any?
extracts the body as json from the given Response

Properties

headers
Link copied to clipboard
js
val headers: Headers
returns the Headers from the given Response
ok
Link copied to clipboard
js
val ok: Boolean
propagate
Link copied to clipboard
js
val propagate: Boolean = true
request
Link copied to clipboard
js
val request: Request
status
Link copied to clipboard
js
val status: Int
statusText
Link copied to clipboard
js
val statusText: String
url
Link copied to clipboard
js
val url: String