Skip to main content
Module

x/oak/http_request.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@v11.1.0/http_request.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
respond(response: Response): Promise<void>