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

x/hono/request.ts>HonoRequest#query

Web Framework built on Web Standards
Extremely Popular
Go to Latest
method HonoRequest.prototype.query
import { HonoRequest } from "https://deno.land/x/hono@v4.3.6/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>