Module

x/hono/mod.ts>HonoRequest#query

Fast, Lightweight, Web-standards
Extremely Popular
Go to Latest
method HonoRequest.prototype.query
import { HonoRequest } from "https://dotland.deno.dev/x/hono@v4.1.0/mod.ts";

.query() can get querystring parameters.

Examples

Example 1

// Query params
app.get('/search', (c) => {
  const query = c.req.query('q')
})

// Get all params at once
app.get('/search', (c) => {
  const { q, limit, offset } = c.req.query()
})

Parameters

key: string

Returns

string | undefined

Returns

Record<string, string>