Skip to main content
Module

x/nhttp/index.ts>RequestEvent

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

Constructors

new
RequestEvent(
request: Request,
_info?: TObject,
_ctx?: TObject,
)

Index Signatures

[k: string | symbol]: TRet

Properties

body: TObject

body as json object.

bodyUsed: boolean

bodyUsed.

readonly
bodyValid

bodyValid.

cookies: TObject

get cookies from request.

file: TObject

file.

headers: Headers

headers.

readonly
info: TInfo

lookup Object info like conn / env / context.

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.