Body

Properties

Link copied to clipboard

The body read-only property of the Request interface contains a ReadableStream with the body contents that have been added to the request. Note that a request using the GET or HEAD method cannot have a body and null is returned in these cases.

Link copied to clipboard
open external val bodyUsed: Boolean

The bodyUsed read-only property of the Request interface is a boolean value that indicates whether the request body has been read yet.

Functions

Link copied to clipboard
inline suspend fun Body.arrayBuffer(): ArrayBuffer

The arrayBuffer() method of the Request interface reads the request body and returns it as a promise that resolves with an ArrayBuffer.

Link copied to clipboard
open external fun arrayBufferAsync(): Promise<ArrayBuffer>

The arrayBuffer() method of the Request interface reads the request body and returns it as a promise that resolves with an ArrayBuffer.

Link copied to clipboard
inline suspend fun Body.blob(): Blob

The blob() method of the Request interface reads the request body and returns it as a promise that resolves with a Blob.

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

The blob() method of the Request interface reads the request body and returns it as a promise that resolves with a Blob.

Link copied to clipboard
suspend fun Body.byteArray(): ByteArray
Link copied to clipboard
inline suspend fun Body.bytes(): Uint8Array<ArrayBuffer>

The bytes() method of the Request interface reads the request body and returns it as a promise that resolves with a Uint8Array.

Link copied to clipboard
open external fun bytesAsync(): Promise<Uint8Array<ArrayBuffer>>

The bytes() method of the Request interface reads the request body and returns it as a promise that resolves with a Uint8Array.

Link copied to clipboard
inline suspend fun Body.formData(): FormData

The formData() method of the Request interface reads the request body and returns it as a promise that resolves with a FormData object.

Link copied to clipboard
open external fun formDataAsync(): Promise<FormData>

The formData() method of the Request interface reads the request body and returns it as a promise that resolves with a FormData object.

Link copied to clipboard
inline suspend fun Body.json(): JsAny?

The json() method of the Request interface reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON.

Link copied to clipboard
open external fun jsonAsync(): Promise<*>

The json() method of the Request interface reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON.

Link copied to clipboard
inline suspend fun Body.text(): String

The text() method of the Request interface reads the request body and returns it as a promise that resolves with a String. The response is always decoded using UTF-8.

Link copied to clipboard
open external fun textAsync(): Promise<JsString>

The text() method of the Request interface reads the request body and returns it as a promise that resolves with a String. The response is always decoded using UTF-8.

Link copied to clipboard
open external fun textStream(): ReadableStream<JsString>