I have my /entities endpoint on my RESTful Web Service, which returns all the stored entities on the database, if called with a GET request.
What I would like to create now, is a pagination functionality. The ability to retrieve only a page of those results, and not all the entities, just for the matter of minimizing the response's size.
I am thinking of two ways of doing this.
Send the pagination information via query parameters on the
/entitiesendpoint with aGETrequest. For example,/entities?page=1&size=10Use another
HTTP Method, likeOPTIONS(I know it's not designed to be used for this kind of thing). I don't handleOPTIONSrequests on my Web Service, and I may take advantage of that, while keeping the essence of a RESTful web service, that is, using differentHTTP Methodsfor different actions. In that case, the endpoint could be something like this:/entities/1/10, which (I think) is more user-friendly.
Both alternatives can be implemented, and I wanted to know beforehand which one would be more compliant with the REST design standard.