Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3755

HTTP status code when single request asks for too large resource or too many of them

$
0
0

Does somebody know which HTTP status code is the right one for the following situation?

An anonymous client requests a range of items from a collection via a RESTful API. The client uses GET method with some range parameters, for example GET /collection/?range_start=100&range_end=200. The OK response from the server contains a list of 100 items in JSON. Also, the server has a limit for the number of items the client can request, let's say 300. What should the response status code be if the client wants too many items, for example thousand items in the range [100, 1100]? That is 700 items over the limit.

Should it be 400 Bad Request, 403 Forbidden, 409 Conflict, 416 Requested Range Not Satisfiable(?) or 422 Unprocessable Entity? What would you recommend?

A related question and answer propose 409 but the situation is slightly different:https://stackoverflow.com/a/13463815/638546


Viewing all articles
Browse latest Browse all 3755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>