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

x/hono/mod.ts>HonoRequest#param

Web Framework built on Web Standards
Extremely Popular
Go to Latest
method HonoRequest.prototype.param
import { HonoRequest } from "https://deno.land/x/hono@v4.2.7/mod.ts";

.req.param() gets the path parameters.

Examples

Example 1

const name = c.req.param('name')
// or all parameters at once
const { id, comment_id } = c.req.param()

Type Parameters

optional
P2 extends string = P

Parameters

key: RemoveQuestion<ParamKeys<P2>>

Returns

UndefinedIfHavingQuestion<ParamKeys<P2>>

Type Parameters

optional
P2 extends string = P

Returns

UnionToIntersection<ParamKeyToRecord<ParamKeys<P2>>>