Skip to main content
Module

x/drash/src/http/request.ts>DrashRequest#queryParam

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
method DrashRequest.prototype.queryParam
import { DrashRequest } from "https://deno.land/x/drash@v2.7.0/src/http/request.ts";

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.