title: What's an appropriate HTTP status code to return by a REST API service for a validation failure?
body: <p>I'm currently returning 401 Unauthorized whenever I encounter a validation failure in my <a href="http://djangoproject.com/" rel="noreferrer">Django</a>/<a href="https://bitbucket.org/jespern/django-piston/wiki/Home" rel="noreferrer">Piston</a> based REST API application.
  Having had a look at the <a href="http://www.iana.org/assignments/http-status-codes" rel="noreferrer">HTTP Status Code Registry</a>
  I'm not convinced that this is an appropriate code for a validation failure, what do y'all recommend?</p>
  
  <ul>
  <li>400       Bad Request</li>
  <li>401       Unauthorized</li>
  <li>403       Forbidden</li>
  <li>405       Method Not Allowed</li>
  <li>406       Not Acceptable</li>
  <li>412       Precondition Failed</li>
  <li>417       Expectation Failed</li>
  <li>422       Unprocessable Entity</li>
  <li>424       Failed Dependency</li>
  </ul>
  
  <p><strong>Update</strong>: "Validation failure" above means an application level data validation failure, i.e., incorrectly specified datetime, bogus email address etc.</p>