2

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
  • I can't think of a reason why parameter name would need to be encoded. I am struggling with the same question, and so far nothing came up in my searches. Commented Jul 25, 2018 at 16:25

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

"won't be parsed" - it depends on the parsing implementation, isn't it (hypothetically, a parsing implementation may decide that for each query string parameter all = except the last one are ignored)? after all, = is allowed unencoded in a query string.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.