x/oak/body.ts

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
class RequestBody
import { RequestBody } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v11.1.0/body.ts?s=RequestBody";

Constructors

new
RequestBody(
unnamed 0: ServerRequestBody,
headers: Headers,
jsonBodyReviver?: (key: string, value: unknown) => unknown,
)
[src]

Methods

has(): boolean[src]

Returns if the request might have a body or not, without attempting to consume it.

WARNING This is an unreliable API. In HTTP/2 it is not possible to determine if certain HTTP methods have a body or not without attempting to read the body. As of Deno 1.16.1 and later, for HTTP/1.1 aligns to the HTTP/2 behaviour.