title: HTTP 200 or 404 for empty list?
body: <p>I know this is a fairly common question, but I haven't found an answer that satisfies me.</p>
  
  <p>I've been using django rest framework for a while now, but this is mostly irrelevant other than the example given. Its default behaviour is to return an HTTP 200 with an empty list resource when accessing a route with an empty list of items.
  E.g.: if we had a route such as <code>/articles/</code> to access a list of articles but it contained no items we would get a response like the following json:</p>
  
  <pre><code>{"count":0, "next":null, "previous":null, "items": []}
  </code></pre>
  
  <p>Which is perfectly fine. We found the resource we were looking for at /articles/, it just happens to have no items in it.</p>
  
  <p>If we access the route <code>/articles/?page=1</code>, we get the exact same response.</p>
  
  <p>So far so good. Now we try to access <code>/articles/?page=2</code>, and the response code changes. Now get get a <code>404</code> as if the resource could not be found with an error message saying that the page contains no results. Which is the same case as with ?page=1...</p>
  
  <p>I was perfectly ok with this behaviour, but today I started questioning this design. How is the <code>?page=1</code> case different than <code>?page=2</code> ? And what's more, how could you tell if the request was "valid" when issuing a HEAD request? Valid in the sense of containing any results.</p>
  
  <p>This could be useful in cases like filtering a list checking the availability of a certain field (for example, issuing a <code>HEAD</code> request to <code>/users/?username=ted</code>).</p>
  
  <ul>
  <li>A 200 response would clearly mean the request was understood and items were found.</li>
  <li>A 404 would mean the request was understood, but no items were found at that location/URI (AFAIK the query parameters are also part of the URI)</li>
  <li>In case the request could not be understood a 400 would be returned for syntactic errors, and a 422 for semantic errors.</li>
  </ul>
  
  <p>Is this a good design? Why do most people seem to disagree with it and what drawbacks are there in it?</p>