Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oak_http_proxy/test/deps.ts>Oak.BodyOptions

Proxy middleware for Deno Oak HTTP servers. 🐿 🦕
Latest
interface Oak.BodyOptions
import { type Oak } from "https://deno.land/x/oak_http_proxy@2.3.0/test/deps.ts";
const { BodyOptions } = Oak;

Options which can be used when accessing the .body() of a request.

Type Parameters

optional
T extends BodyType = BodyType

the BodyType to attempt to use when decoding the request body.

Properties

optional
limit: number

When reading a non-streaming body, set a limit whereby if the content length is greater then the limit or not set, reading the body will throw.

This is to prevent malicious requests where the body exceeds the capacity of the server. Set the limit to 0 to allow unbounded reads. The default is 10 Mib.

optional
type: T

Instead of utilizing the content type of the request, attempt to parse the body as the type specified. The value has to be of BodyType.

optional
contentTypes: BodyOptionsContentTypes

A map of extra content types to determine how to parse the body.