Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL: semicolon instead of question mark

Tags:

rest

url

I'm calling a web service in this format:

http://some.server/rest/resource;a=b

It works but is this valid? I've seen the ; used as a replacement for the & but never seen such an url. I've been looking for an answer but did not find a valid one. If valid what is the meaning of this kind of url?

like image 790
Carlo Bertuccini Avatar asked Sep 16 '13 14:09

Carlo Bertuccini


People also ask

Are semicolons allowed in URLs?

According to the 2014 W3C Recommendation, semicolon is now illegal as a parameter separator in a http URI.

Can a URL have a question mark?

What Does a Question Mark in URL Do? URLs have query strings that specify parameters through a group of characters typed into a browser to retrieve information. A question mark is not a part of the query string, but it's used to establish boundaries and is considered a separator.

What is the separator of query in a URL?

The question mark is used as a separator, and is not part of the query string. The exact structure of the query string is not standardized. Methods used to parse the query string may differ between websites. A link in a web page may have a URL that contains a query string.

Which character replaces a semicolon in any portion of the URL string?

Save this question.


1 Answers

This is a part of the path parameters and not part of the query parameters. You can find detailed information on how URLs can be built at http://www.skorks.com/2010/05/what-every-developer-should-know-about-urls/

Edit: I was actually looking for this link earlier which explains it even better and shows you some weird but valid cases: https://www.talisman.org/~erlkonig/misc/lunatech%5Ewhat-every-webdev-must-know-about-url-encoding/ (originally at the now dead url http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding)

But anyway, this is valid: http://www.blah.com/some/crazy/path.html;param1=foo;param2=bar

like image 79
Sebastiaan van den Broek Avatar answered Nov 20 '22 23:11

Sebastiaan van den Broek