13

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?

Janusz
  • 187,060
  • 113
  • 301
  • 369
Carlo Bertuccini
  • 19,615
  • 3
  • 28
  • 39
  • 1
    See http://stackoverflow.com/questions/2048121/url-matrix-parameters-vs-request-parameters –  Sep 16 '13 at 14:28

3 Answers3

17

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

Sebastiaan van den Broek
  • 5,818
  • 7
  • 40
  • 73
2

RFC2396 where path parameters were specified is obsolete. newer version is RFC 3986 -- this one does not have path parameters before the query string formally specified, however still has it in section 5.4.1 in examples.

0

This might answer your question: Semicolon as URL query separator

We recommend that HTTP server implementors, and in particular, CGI implementors support the use of ";" in place of "&" to save authors the trouble of escaping "&" characters in this manner.

Community
  • 1
  • 1
aCa
  • 157
  • 5