x/oak/mod.ts

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
type alias BodyType
import { type BodyType } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v11.1.0/mod.ts?p=prototype.allowedMethods&s=BodyType";

The type of the body, where:

  • "bytes" - the body is provided as a promise which resolves to an {@link Uint8Array}. This is essentially a "raw" body type.
  • "form" - the body was decoded as a form with the contents provided as a promise which resolves with a {@link URLSearchParams}.
  • "form-data" - the body was decoded as a multi-part form data and the contents are provided as a promise which resolves with a FormDataReader.
  • "json" - the body was decoded as JSON, where the contents are provided as the result of using JSON.parse() on the string contents of the body.
  • "text" - the body was decoded as text, where the contents are provided as a string.
  • "reader" - the body is provided as {@link Deno.Reader} interface for reading the "raw" body.
  • "stream" - the body is provided as a {@link ReadableStream<Uint8Array>} for reading the "raw" body.
  • "undefined" - there is no request body or it could not be decoded.
definition:
| "bytes"
| "form"
| "form-data"
| "json"
| "text"
| "reader"
| "stream"
| "undefined"
[src]