Trident D'Gao
Trident D'Gao

Reputation: 19772

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

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?

Upvotes: 2

Views: 1736

Answers (1)

Quentin
Quentin

Reputation: 944531

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.

Upvotes: 1

Related Questions