Adam,
Thanks for the information
I use basically the first form.
What's with the $ and ! in there?? I just name my variables what they
are, generally using common java naming conventions, or
hyphen/underscore if need be.
I'm using the $ or ! as qualifiers on a resource property for instance a
timeStamp etc.
?registeredDateFrom=2003-03-03®isteredDateTo=2005-05-05
When you're specifying ranges like this, you're going to have one
less-than and one greater-than comparator ultimately in your SQL
statement (or a BETWEEN statement). Therefore, you usually don't allow
users to specify the equality operator since you've pretty much defined
what the range is going to be.
If you do need to encode an equality operator, I would suggest using
"eq", "ne", "lt", "lte", "gt", "gte" which are common abbreviations.
Remember the REST form. Generally, query string parameters should be
for "optional" data. If the "from" and "to" fields are required fields
(the user can't make a query without these specified), then you could
(should even) use the form:
/cars/2003-03-03/2005-05-05/
Ie. no query string, but actual "parameters" in the uri. This is a
slightly better form (though obviously not different functionally).
I guess its personal preference but I feel it is more readable,
expressive and consistent using the query string since in most cases the
result set will be constrained by a date range and some other resource
property like 'make'
/cars/registered/2003-03-03/2005-05-50?make=holden
/cars?make=holden®isteredDate!From=blah®isteredDate!To=blah
My point is, what is the /cars URL (without the query string) going to
return to the user?? It should be defined to return some list and the
query string parameters will modify the default criteria for said list.
/cars will return all car resources (i.e unconstrained) the query string
will simply constrain the result set.
cheers
</jima>