HTTP/1.1 Status Codes 400 and 417, cannot choose which

Posted by TheDeadLike on Server Fault See other posts from Server Fault or by TheDeadLike
Published on 2012-09-30T20:39:46Z Indexed on 2012/09/30 21:39 UTC
Read the original article Hit count: 490

I have been referred to here that it might be of better help, I've got a processing file which handles the user sent data, before that, however, it compares the input from client to the expected values to ensure no client-side data change.

I can say I don't know lot about HTTP status codes, but I have made up some research on it, and to choose which one is the best for unexpected input handling. So I came up with:

400 Bad Request: The request cannot be fulfilled due to bad syntax

417 Expectation Failed: The server cannot meet the requirements of the Expect request-header field

Now, I cannot be really sure which one to use, I have seen 400 Bad Request being used alot, however, whatI get from explanation is that the error is due to an unexistent request rather than an illegal input.

On the other side 417 Expectation Failed seems to just fit for my use, however, I have never seen or experimented this header status before.

I need your experience and opinions, thanks alot!

For a full detailed with form/process page drafts, and my experiments, follow this link.

© Server Fault or respective owner

Related posts about http

Related posts about http-headers