title: REST API Status Code Pagination
body: <p>I am currently writing an REST API using the Jersey Framework. I am following the HATEOAS principle and the user should only be moving through the api by the given links in my response body oder headers. On some Resources I have implemented pagination functionality. I was wondering though, what should I tell the User (HTTP Status Code), when he is not following my boundaries and just like randomly makes a request where the requested page is actually "out of bounds". Currently I just return a null Collection, but I think as a User, I wouldn't be able to make something out of such a response. I considered using the Status Code "Not Found", but I am not sure if that is the appropriate one. I really want to stay true to REST and that implicates I stay true to HTTP. So can anyone give me suggestions or even tell me if there is actually a rule for my problem?</p>
  
  <p>Maybe a concrete example:</p>
  
  <ul>
  <li>page size = 10; </li>
  <li>Collection.size = 27;</li>
  <li>requested page = 4;</li>
  <li>Paging starts with page 0</li>
  </ul>
  
  <p>, so requesting <code>http://...../resource?page=0</code>, returns the first page. 
  My question is, what should I return for the request <code>http://...../resource?page=4</code>? Currently I am just returning null, but I don't think that's the proper response.
  Thanks in advance</p>
  
  <p>EDIT:
  I am only asking about the expected Response in case the requested page is "empty". I know that fixed page size design may be doomed for future change requests, but since this API is part of a Microservice, there will be none, except we have a fight inside our team :)</p>