Re: HTTP/1.1 Error Responses

Roy T. Fielding (fielding@kiwi.ics.uci.edu)
Wed, 24 Mar 1999 13:43:01 -0800


>My question concerns the appropriate response code to use when rejecting
>a request as incomplete or otherwise unacceptable.  For instance, if
>the users submits a form without supplying a value for a necessary
>field (say an email address), or with an in-appropriate value (say a
>non-existent file type).  
>
>The server process detects this and wants to reply to say that it
>has rejected the request.  What code should be used in the HTTP header?
>
>Typically, I suspect a CGI application will use "200 OK", even though the
>body of the message then says "I can't do that because....".  However,
>Section 10.2.1 says that "200 OK" means the request has succeeded, which it
>hasn't....

Actually, it has.  POST means only that data has been supplied to the
process, to do with as it wishes. As far as HTTP is concerned, the request
was successfully completed.

>It seems that a "4xx" code would be right.  But which one?  

Either 200 or 400.  None of the others are appropriate because they refer
to specific HTTP interoperability concerns, not to POST data.

....Roy