5

This is really similar to this question : Is a url query parameter valid if it has no value?

However what if I still use the symbol = like:

http://example.com/foo?bar=&pam=e

Reason is that I use built-in function to generate URL, and when I set bar to nothing, it does this in shown format.

Community
  • 1
  • 1
Cher
  • 2,789
  • 10
  • 37
  • 64
  • This question is more accurately a duplicate of this post: http://stackoverflow.com/questions/21291562/is-passing-a-query-string-parameter-whose-value-is-null-without-the-equals-sig – Cameron Aug 15 '16 at 17:20
  • 2
    As the accepted answer to the linked question says: "The URI RFC doesn't mandate a format for the query string. Although it is recognized that the query string will often carry name-value pairs, it is not required to." So there is no rule to break, and the query string is valid, with or without equal sign. – m69's been on strike for years Aug 15 '16 at 17:27
  • Possible duplicate of [Is a url query parameter valid if it has no value?](http://stackoverflow.com/questions/4557387/is-a-url-query-parameter-valid-if-it-has-no-value) – m69's been on strike for years Aug 15 '16 at 17:27
  • @m69 the link you mentionned above was asking for a param without the "=" symbol. Thanks for your answer! Now I know my implementation is gonna be fine!! – Cher Aug 15 '16 at 17:57

0 Answers0