Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter separator in URLs, the case of misused question mark

Tags:

http

url

web

What I don't really understand is the benefit of using '?' instead of '&' in urls:

question mark vs ampersand

It makes nobody's life easier if we use a different character as the first separator character. Can you come up with a reasonable explanation?

EDIT: after more research I found that "&" can be a part of file name (terms&conditions.html) so "?" is a good separator. But still I think using "?" for separators makes lives easier (from url generators and parsers point of view):

question mark as separator

Is there any advantage in using "&" which is not clear at the first glance?

like image 492
el_shayan Avatar asked Mar 01 '12 17:03

el_shayan


1 Answers

From the URI spec's (RFC 3986) point of view, the only separator here is "?". the format of the query is opaque; the ampersands just are something that HTML happens to use for form submissions.

like image 89
Julian Reschke Avatar answered Sep 20 '22 13:09

Julian Reschke