Background
Our team has brought up the idea of using status code 206 - Partial Content in our REST API to indicate that GET requests over large datasets have more content than was returned, in order to allow the API user to paginate. This would be an alternative to the hasMore flag we are currently use in the response body.
Pro
- Using a known status code would allow users of the API to rely on common HTTP language instead of learning our 'proprietary' language.
- The claim that it would be very fitting to signal whether or not there are more results.
Con
- Since all requests have a
pageSizenumeric query parameter, it might be incorrect to communicate206 - Partial Contentsince the response contains all the results that were requested by thepageSizequery param. - The claim that
206 - Partial Contentis commonly used for byte streams, not for lists of collections.
Question
In which cases could or should 206 - Partial Content be used for pagination of results sets sent in response to restful GET requests?