title: HTTP 403 or 406 for post requirements violation?
body: <p>Simple question:</p>
  
  <p>I have a POST endpoint which expects some text input. The text input must not be longer than x characters. If it is I'll respond with an error message.</p>
  
  <p>But which HTTP status code will be the correct one?</p>
  
  <blockquote>
    <p>0.4.4 403 Forbidden</p>
    
    <p>The server understood the request, <strong>but is refusing to fulfill it.</strong> 
    Authorization will not help and the request SHOULD NOT be repeated. [..]</p>
    
    <p>10.4.7 406 Not Acceptable</p>
    
    <p>The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.</p>
    
    <p>10.4.18 417 Expectation Failed</p>
    
    <p>The expectation given in <strong>an Expect request-header field [..] could not be met</strong> by this server [..]</p>
  </blockquote>
  
  <p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" rel="nofollow">Source: w3.org</a></p>