Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hono/mod.ts>HonoRequest

Ultrafast web framework for the Edges
Extremely Popular
Go to Latest
class HonoRequest
import { HonoRequest } from "https://deno.land/x/hono@v3.1.4/mod.ts";

Constructors

new
HonoRequest(
request: Request,
path?: string,
paramData?: Record<string, string> | undefined,
)

Type Parameters

optional
P extends string = "/"
optional
I extends Input["out"] = { }

Properties

private
paramData: Record<string, string> | undefined
private
validatedData: [K in keyof ValidationTargets]?: { }
readonly
body
readonly
bodyUsed
readonly
cache
readonly
credentials
readonly
headers
readonly
integrity
readonly
keepalive
readonly
method
readonly
mode
path: string
raw: Request
readonly
redirect
readonly
refererPolicy
readonly
referrer
readonly
signal
readonly
url

Methods

addValidatedData(target: keyof ValidationTargets, data: { })
header(name: string): string | undefined
header(): Record<string, string>
json<T = any>(): Promise<T>
param(key: RemoveQuestion<ParamKeys<P>>): UndefinedIfHavingQuestion<ParamKeys<P>>
param(): UnionToIntersection<ParamKeyToRecord<ParamKeys<P>>>
parseBody(): Promise<BodyData>
queries(key: string): string[] | undefined
queries(): Record<string, string[]>
query(key: string): string | undefined
query(): Record<string, string>
valid<T extends keyof ValidationTargets = I extends Record<infer R, unknown> ? R extends keyof ValidationTargets ? R : never : never>(target: T): InputToDataByTarget<I, T>
valid(): never