Skip to main content
Module

x/hono/request.ts>HonoRequest#query

Fast, Lightweight, Web-standards
Extremely Popular
Go to Latest
method HonoRequest.prototype.query
import { HonoRequest } from "https://deno.land/x/hono@v4.2.5/request.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>