Proper REST formatted URL with date ranges

Solution 1:

http://example.com/users/12345/bids?start=01-01-2012&end=01-31-2012

Have the query parameters on the same "level" as the bids (remove the slash before the question mark). But you would probably want to have support for if they only provide one query parameter. So if they only provided "start" then it would get all bids after that date, or if they only provided "end" it would get all bids before that date.

The reasoning being that query parameters are good for GETting a subset of results from a GET request. They don't go on another level because the next level is usually one specific item with a unique identifier.

Solution 2:

I would go with http://example.com/users/12345/bids?start=2012-01-01&end=2012-01-31.

  • There shouldn't be a slash before the query string.
  • Avoid using slashes in the query string. It'll be easier that way.