Choosing http status code for unknown command reply

Posted by w0rldart on Stack Overflow See other posts from Stack Overflow or by w0rldart
Published on 2012-12-02T17:01:48Z Indexed on 2012/12/02 17:03 UTC
Read the original article Hit count: 291

Filed under:
|
|

So, I'm writing a small test that I have been required to complete and I just want to give it some final touches by adding some header status code responses and some other stuff.

Right now, my dilemma is what HTTP status code to choose for my "Unknown command" response after the $_GET['cmd'] has been compared to the existing commands list.

case 404: $text = 'Not Found'; break;
case 405: $text = 'Method Not Allowed'; break;
case 406: $text = 'Not Acceptable'; break;

For which one of the above should I go? And if none, which other?

© Stack Overflow or respective owner

Related posts about api

Related posts about http