I am designing a REST like API for paginated data retrieval of a YUI-based client. The REST URL looks like this for a GET request:
/app/catalog/data?startIndex=<int>&results=<int>&sort=<sting>&dir=<string>
All parameters are optional, i.e. if no parameters are given, all data from DB will be dumped. Now say that there are only 1000 records in the database. Following reqeust is made:
/app/catalog/data?startIndex=1100&results=25
What status code should I return if the paginated result from the database remains empty though the request was fine?! I can't decide whether this is 204
or 404
.
The produced media types are JSON and CSV.
404
in this case? An invalid sort column would be aBad Request
. – Libertarian