Open akrabat opened 7 years ago
If you implemented a route in Express that had a GET
but no POST
, what would you get? I believe the Method Not Allowed
error is for a method + route that does exist, but has been disabled for some reason.
I don't use JS, so I haven't a clue what Express does.
The specification seems quite clear that 405 is to be used when the method is not supported by the resource (/hello
in this case):
The 405 (Method Not Allowed) status code indicates that the method received in the request-line is known by the origin server but not supported by the target resource.
Googling, I see that Express doesn't do this because it's too complicated to do in their codebase: https://github.com/expressjs/express/issues/1895#issuecomment-33279114
API Gateway shouldn't have this problem as it knows all the valid methods for any given path as we have to create them... (of course, I'm making assumptions here!)
any updates?
Given an API Gateway set up to only accept GET, if I try to POST to it, I get a
404
back.I should get a
405
as the resource exists (i.e. was found), but I'm not allowed to access it with this method.