You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1999/01/08 18:21:58 UTC

Re: 405 vs. 501

>I am sure that I have gone through this exact same thought process before,
>but I can't find a trace of where I may have asked it and got an answer.
>
>If I write a CGI script that only supports POST, should it return 501 or
>405 if you try it with a GET?
>
>It is true that "the method is known by the server but not allowed for the
>requested resource", and not true that "the method is unrecognized or
>not implemented by the server" so it should be a 405.
>
>But my CGI sure can't know what methods "the server" supports.

The CGI is the server.  501 should only be returned if the server is
configured to block methods that it doesn't recognize.  It is a leftover
from the days before httpd acted as gateways.

....Roy