HTTP status · 4xx — client error
405 Method Not Allowed
405 Method Not Allowed means the URL exists but does not support the HTTP method used in the request.
Key facts
| Class | 4xx — client error |
|---|---|
| Standard | RFC 9110 §15.5.6 |
| Required header | Allow |
| Cacheable by default | Yes (heuristically) |
| Typical cause | POST to a GET-only route |
What 405 means
The server recognized the resource but the request method is not supported for it. The response must list the supported methods in an Allow header, for example Allow: GET, HEAD. This is different from 404: the path exists, so the client should change the method rather than the URL.
Common causes
A form posts to an endpoint that only implements GET; a client uses PUT where the API implements PATCH; a CORS preflight sends OPTIONS to a route that does not answer it; or a proxy rewrites the method. Read the Allow header first — it tells you which method the route actually accepts.
Frequently asked questions
What is the difference between 404 and 405?
404 means the URL has no representation. 405 means the URL exists but does not accept the method you used.
Why does my API return 405 for OPTIONS?
The route does not handle CORS preflight. Add an OPTIONS handler or let your framework respond with the allowed methods and CORS headers.