What it means
The URL exists, but it doesn't support the request method, such as a DELETE on a read-only resource. The response must include an Allow header listing the methods it does support.
Why you're seeing it
- Sending
POSTto a route that only handlesGET, or the other way round. - A form posting to a static file. Static hosts often answer
POSTwith405. - Missing
OPTIONShandling for CORS preflight requests.
How to fix it
- Check the method against the API docs or the
Allowheader. - Make sure the router registers the method you expect, including
OPTIONSandHEAD.
Example response
HTTP/1.1 405 Method Not Allowed Allow: GET, HEAD, OPTIONS Content-Length: 0