Correct way to pass multiple values for same parameter name in GET request

I’m looking into what is the correct way to pass multiple values for the same parameter name in a GET request.

I’ve seen URLs like this:

http://server/action?id=a&id=b

And I’ve seen URLs like this:

http://server/action?id=a,b

My understanding is that the first is correct, but I can’t find any reference for this. I had a look at the http spec but couldn’t see anything about how the ‘query’ part of a URL should be made up.

I don’t want an answer that says “either is fine” – if I’m building a webservice, I want to know which of these methods is standard so that people using my webservice know how to pass multiple parameters for the same name.

So, can someone point me at an official reference source to confirm which option is correct?

7 Answers
7

Leave a Comment