title: Which HTTP status code to use for required parameters not provided?
body: <p>I have several pages designed to be called with AJAX - I have them return an abnormal status code if they can't be displayed, and my javascript will show an error box accordingly.</p>
  
  <p>For example, if the user is not authenticated or their session has timed out and they try to call one of the AJAX pages, it will return <code>401 Unathorized</code>.</p>
  
  <p>I also have some return <code>500 Internal Server Error</code> if something really odd happens server-side.</p>
  
  <p>What status code should I return if one of these pages was called without required parameters? (and therefore can't return any content).</p>
  
  <p>I had a look at the <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">wikipedia article on HTTP status codes</a>, but the closest one I could find to the code I'm looking for was this:</p>
  
  <blockquote>
    <p><strong>422 Unprocessable Entity</strong><br />
    The request was well-formed but was unable to be followed due to semantic errors.</p>
  </blockquote>
  
  <p><em>Edit: The above code is WebDAV specific and therefore unlikely to be appropriate in this case</em></p>
  
  <p>Can anyone think of an appropriate code to return?</p>