Our API user can get the root document (collection list) by sending GET
request to root API address. If he sends POST
, we should return something. The same question applies for other resource paths, like e.g. sending PATCH
on query path etc. Not all methods have meaning on some paths.
As I see from HTTP RFCs is that we should return code 405
: Method not allowed and sending back the Allowed
response header with list of allowed methods.
I see that e.g. GitHub API returns 404
: Not found in the case I explained above (sending POST
to root).
What would be the proper response? 404
or 405
? I see 405
more developer-friendly, so is there any reason not to use it?