Should I encode names of parameters in a query string of a URI?

1.5k Views Asked by At

I know I need to encode the arguments of parameters in a query string of a URI, but what about the parameter names, do they need to be encoded too?

1

There are 1 best solutions below

1
Quentin On

Yes. Special characters in query strings have their special meaning anywhere in the query string.

If the parameter name is foo=bar then ?foo=bar=something won't be parsed as foo=bar equals something.