Skip to main content
Module

x/nhttp/index.ts>RequestEvent

An Simple web-framework for Deno and Friends.
Go to Latest
class RequestEvent
Re-export
import { RequestEvent } from "https://deno.land/x/nhttp@1.2.22/index.ts";

Constructors

new
RequestEvent(request: Request)

Type Parameters

optional
O extends TObject = TObject

Index Signatures

[k: string | symbol]: TRet

Properties

body: TObject

body as json object.

cookies: TObject

get cookies from request.

file: TObject

file.

headers: Headers

headers.

readonly
info: TInfo<O>

lookup Object info like conn / env / context. requires showInfo flags.

method: string

Http request method.

readonly
originalUrl

originalUrl

params: TObject

params as json object.

path: string

lookup path

query: TObject

lookup query parameter

readonly
response: HttpResponse

response as HttpResponse

readonly
responseInit: ResponseInit

Lookup responseInit.

readonly
route: MatchRoute

lookup self route

url: string

url

Methods

deprecated
getCookies(decode?: boolean)

get cookies from request

respondWith(r: Response | PromiseLike<Response>): void | Promise<void>

The method to be used to respond to the event. The response needs to either be an instance of Response or a promise that resolves with an instance of Response.

send(body?: TSendBody, lose?: number): void

send body

waitUntil(promise: Promise<TRet>)

This method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful.

[deno_inspect](inspect: TRet, opts: TRet)
[node_inspect](
depth: number,
opts: TRet,
inspect: TRet,
)