http url input parameters

Is this a valid http url

http://www.example.com?x&y

or

we must always have = sign for parameters.

http://www.example.com?x1=x&x2=y

Answers


Well, it works, and the W3C recommendations are extremely general -- only the use of ? and + are defined. So I think from the perspective of HTTP/HTML the = is optional. It's use is obviously a common convention and many client & server libraries use it, but there doesn't seem to be any reason you couldn't define a service to work on some other scheme.

Anecdotally, I like to leave out the =blah part when I'm using the query string as a flag as in http://www.example.com?logout

Reference: http://www.w3.org/Addressing/URL/4_URI_Recommentations.html


According to the ABNF in Appendix A of RFC 3986, both examples above are valid URL.

Note that if you read only the Wikipedia article on Query string, you might get the false impression that the second ne is the only valid one.


Need Your Help

Javascript + Unicode regexes

javascript regex unicode character-properties

How can I use Unicode-aware regular expressions in JavaScript? For example, there should be something akin to \w that can match any code-point in Letters or Marks category (not just the ASCII ones)...

MOXA Nport 5110A Driver Failed Installation (On Linux Ubuntu 14.04)

driver ubuntu-14.04 failed-installation

I am trying to install MOXA Nport 5110A Driver in my Linux Ubuntu 14.04, but failed miserably. The details about installation process is too long for me to understand where the problem is (and fran...