Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/oak/mod.ts>HttpRequest

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
class HttpRequest
implements ServerRequest
import { HttpRequest } from "https://deno.land/x/oak@v12.1.0/mod.ts";

An abstraction which wraps a Request from Deno's flash server. The constructor takes a Deferred which it will resolve when the response is ready.

This request can be used in situations where there isn't a specific method to respond with, but where a Promise<Response> is accepted as a value. It is specifically designed to work with Deno's flash server.

Constructors

new
HttpRequest(
request: Request,
deferred: Deferred<Response>,
upgradeWebSocket?: UpgradeWebSocketFn,
)

Properties

readonly
headers: Headers
readonly
method: string
readonly
remoteAddr: string | undefined
readonly
url: string

Methods

error(reason?: any): void
getBody(): ServerRequestBody
respond(response: Response): Promise<void>
upgrade(options?: UpgradeWebSocketOptions): WebSocket