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

x/hono/mod.ts>Context

Lightweight, Ultrafast, Web Standards
Extremely Popular
Go to Latest
class Context
import { Context } from "https://deno.land/x/hono@v3.7.1/mod.ts";

Constructors

new
Context(req: HonoRequest<P, I["out"]>, options?: ContextOptions<E>)

Type Parameters

optional
E extends Env = any
optional
P extends string = any
optional
I extends Input = { }

Properties

private
_exCtx: FetchEventLike | ExecutionContext | undefined
private
_h: Headers | undefined
private
_init: boolean
private
_pH: Record<string, string> | undefined
private
_renderer: Renderer
private
_res: Response | undefined
private
_status: StatusCode
private
_var: E["Variables"]
private
notFoundHandler: NotFoundHandler<E>
body: BodyRespond
env: E["Bindings"]
error: Error | undefined
readonly
event: FetchEventLike
readonly
executionCtx: ExecutionContext
finalized: boolean
get: Get<E>
header: (
name: string,
value: string | undefined,
options?: { append?: boolean; },
) => void
html: HTMLRespond
json: JSONRespond
jsonT: JSONTRespond
newResponse: NewResponse
notFound: () => Response | Promise<Response>
redirect: (location: string, status?: StatusCode) => Response
render: Renderer
req: HonoRequest<P, I["out"]>
deprecated
readonly
runtime: Runtime
set: Set<E>
setRenderer: (renderer: Renderer) => unknown
status: (status: StatusCode) => void
stream: (
cb: (stream: StreamingApi) => Promise<void>,
arg?: StatusCode | ResponseInit,
headers?: HeaderRecord,
) => Response
streamText: (
cb: (stream: StreamingApi) => Promise<void>,
arg?: StatusCode | ResponseInit,
headers?: HeaderRecord,
) => Response
text: TextRespond
readonly
var: Readonly<E["Variables"]>