Skip to main content
Module

x/deno/js/dom_types.ts>Body

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Body
import { type Body } from "https://deno.land/x/deno@v0.14.0/js/dom_types.ts";

Properties

readonly
body: ReadableStream | null

A simple getter used to expose a ReadableStream of the body contents.

readonly
bodyUsed: boolean

Stores a Boolean that declares whether the body has been used in a response yet.

Methods

arrayBuffer(): Promise<ArrayBuffer>

Takes a Response stream and reads it to completion. It returns a promise that resolves with an ArrayBuffer.

blob(): Promise<Blob>

Takes a Response stream and reads it to completion. It returns a promise that resolves with a Blob.

formData(): Promise<FormData>

Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object.

json(): Promise<any>

Takes a Response stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as JSON.

text(): Promise<string>

Takes a Response stream and reads it to completion. It returns a promise that resolves with a USVString (text).