x/oak/mod.ts

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

An abstraction which wraps a Request from Deno's flash server. The constructor takes a {@link 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,
)
[src]

Properties

readonly
headers: Headers
[src]
readonly
method: string
[src]
readonly
remoteAddr: string | undefined
[src]
readonly
url: string
[src]

Methods

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