Skip to content

Function.stringifyQuery

github-actions[bot] edited this page Nov 18, 2026 · 13 revisions

umt / stringifyQuery

Function: stringifyQuery()

stringifyQuery(parameters): string

Defined in: URL/stringifyQuery.ts:20

Serializes a key-value record into a query string.

The inverse of parseQueryString. Keys and values are encoded as application/x-www-form-urlencoded, the same way buildUrl appends parameters. The result has no leading "?".

Parameters

parameters

Record<string, string>

An object of key-value pairs to serialize

Returns

string

The query string, or an empty string for an empty record

Example

stringifyQuery({ page: "1", q: "search" });
// "page=1&q=search"

stringifyQuery({ q: "hello world", tag: "a&b" });
// "q=hello+world&tag=a%26b"

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally