Skip to main content
Module

x/drash/tests/deps.ts>Drash.Request#queryParam

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
method Drash.Request.prototype.queryParam
import { Drash } from "https://deno.land/x/drash@v2.7.0/tests/deps.ts";
const { Request } = Drash;

Find a query string parameter.

Examples

Example 1

// Assume url is "http://localhost:1336/users?city=London&country=England"
const city = this.queryParam("city") // Returns "London"
const country = this.queryParam("country") // Returns "England"

Parameters

name: string
  • The name of the query string.

Returns

string | undefined

The value of the param if found, or undefined if not.