(key, value) tuples.parseQueryParamsDecoded
Parse a query string into key/value pairs with optional form-style decoding.
Performs the same splitting semantics as parseQueryParams, then applies:
- If
plusAsSpaceis true, maps `+` to space (U+0020) before percent-decoding, emulatingapplication/x-www-form-urlencodedbehavior. - Percent-decodes
%HHescapes in both keys and values usingpctDecode.Parameters
qQuery string without the leading `?`. plusAsSpaceIf true, interpret `+` as space prior to decoding.Returns
Array of decodedExamples
import std.typecons : tuple; auto p1 = parseQueryParamsDecoded("q=hello%20world", false); assert(p1[0] == tuple("q", "hello world")); auto p2 = parseQueryParamsDecoded("q=hello+world+%2B&u=%E2%82%AC", true); assert(p2[0] == tuple("q", "hello world +")); assert(p2[1] == tuple("u", "€"));