I am trying to create a more advanced request mechanism for REST. Suppose I have the following:
GET /data/users
and it returns a list of users. Then, to filter the returned users, for example, I would say:
GET /data/users?age=30
to get a list of 30 year old users. Now let me say that I want users between the ages of 30 and 40. I would like to have essentially a set of reusable operators, such as:
GET /data/users?greaterThan(age)=30&lessThan(age)=40
Major and minor will be reused in other numeric, date, etc. It would also allow me to add other operators (contains, starts with, ends with, etc.). I am a REST noob, so I'm not sure if this violates any basic principles of REST. Any thoughts?
source
share