16 chars · 1 line
34 chars · 4 lines
16 chars · 1 line
34 chars · 4 lines
Query parameter edge case
A query segment such as =value is still a name/value pair. The name is the empty string, so the parsed JSON contains an empty-string key. This tool is free to use. No account or payment is required.
Last updated
=value has an empty parameter name and a non-empty value. name= has a non-empty name and an empty value.
URLSearchParams preserves both forms rather than silently discarding them.
The first parameter becomes the empty-string property.
?=value&name=ada{
"": "value",
"name": "ada"
}Common questions
No. URLSearchParams preserves it as an empty-string key.
No. name= has a name and an empty value; =value has an empty name.
That is application-specific. The parser shows the actual query data so you can decide whether to reject it upstream.
Debugging a specific Query String issue? Browse Query String troubleshooting.