Modern REST, GraphQL-over-GET, and webhook endpoints regularly pack multi-value arrays, nested filter objects, Base64 cursors, and URL-encoded search phrases into a single query string or application/x-www-form-urlencoded request body. Inspecting or editing those payloads as a flat raw string invites broken %26 escapes and mismatched brackets.
Consider an API search query combining +-encoded whitespace, repeated keys, nested bracket filters, a Base64 pagination cursor with percent-encoded = padding, and a bare flag parameter:
?q=distributed+tracing&tag=otel&tag=grpc&filter[status]=open&filter[priority]=high&cursor=eyJpZCI6NDIwfQ%3D%3D&dry_run
Parsing this string produces an immediately readable, strongly structured JSON representation:
{
"q": "distributed tracing",
"tag": [
"otel",
"grpc"
],
"filter": {
"status": "open",
"priority": "high"
},
"cursor": "eyJpZCI6NDIwfQ==",
"dry_run": ""
}
Why Delimiter Splitting Must Precede Percent-Decoding
Notice how cursor=eyJpZCI6NDIwfQ%3D%3D decodes cleanly to "eyJpZCI6NDIwfQ==". The parser splits the raw string on & first, splits each pair on the first literal =, and only then decodes + and %XX sequences. If a naive script ran decodeURIComponent() across the entire query string before splitting on & and =, any parameter value containing an escaped ampersand (R%26D -> R&D) would fracture into two bogus parameters.
Because the JSON view and key-value table stay synchronized bidirectionally, you can also paste a JSON filter object from your application code and immediately serialize a properly escaped query string ready for HTTP requests.