tags:

views:

33

answers:

2

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

+2  A: 

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

Devin Ceartas
+1  A: 

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.

Franci Penov