0

Possible Duplicate:
Getting a count of returns seen by a RESTful request

I have a rest web service that retrieves a list of entites as json, ready to be paginated, something like this:

http://localhost:9001/events?page=1&len=3&order=name%20desc&filter=quilmes
[
  {
    id: 222,
    field: "name",
    prev: "",
    operation: "insert",
    date: "2012-01-01T10:32:10Z",
  } [...]
]

In order to display the browse page I need to return the total number of entities

I was thinking about the followgin alternatives:

http://localhost:9001/events?filter=quilmes&op=count

http://localhost:9001/events/count?filter=quilmes

I think the second option is better because it shows I'm accesing a differente resource

Anyway, I wanted to know if there's some standard (I know there are not many standards in the REST world), established patter, recommended practice, or any advice you can give me for this particular case...

Community
  • 1
  • 1
opensas
  • 60,462
  • 79
  • 252
  • 386
  • 1
    Duplicate of: http://stackoverflow.com/questions/1610862/getting-a-count-of-returns-seen-by-a-restful-request , http://stackoverflow.com/questions/3715981/whats-the-best-restful-method-to-return-total-number-of-items-in-an-object , http://stackoverflow.com/questions/5393558/how-should-i-implement-a-count-verb-in-my-restful-web-service – jmclem Jun 19 '12 at 07:21
  • thanks jmclem, I'll try to search a bit harder next time ;-) – opensas Jun 19 '12 at 08:24

0 Answers0