Runs in your browser. Your files and text never leave your device - nothing is uploaded.
4xx Client Error
What it means
The HTTP method used (GET, POST, etc.) isn't supported for this particular resource.
| Property | Detail |
|---|---|
| Status class | 4xx Client Error |
| Defined in | RFC 9110, Section 15.5.6 |
| Cacheable by default | Yes. RFC 9110 lists it as heuristically cacheable, so a cache may reuse it without explicit freshness headers unless Cache-Control says otherwise. |
| Who needs to act | The client, unless the server's routing is missing a handler it should have. |
What does HTTP 405 Method Not Allowed mean?
HTTP 405 Method Not Allowed means the server knows the HTTP method, such as POST or DELETE, but the requested URL does not support it. The resource exists; only the method is wrong. The server must send an Allow header listing the methods the URL accepts, which usually points straight to the fix.
How 405 Method Not Allowed works
RFC 9110 makes the Allow header mandatory on a 405, so the response always tells you which methods would work. The difference from 501 Not Implemented is scope: 405 means the server supports the method but not for this resource, while 501 means the server does not support the method anywhere. Framework routing produces most 405s. In the Next.js App Router, for example, calling a route handler with a method it does not export returns 405, and nginx answers 405 when a form POSTs to a static file.
Example 405 request and response
DELETE /api/articles/18 HTTP/1.1
Host: api.example.com
HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD, PATCH
Content-Type: application/jsonThe article exists and can be read or edited, but this API does not allow deleting it, as the Allow header shows.
What causes a 405 Method Not Allowed
- A form or fetch() call using POST against an endpoint that only defines GET.
- A missing handler for PUT, PATCH or DELETE in the API framework.
- An HTML form posting to a static file or a static hosting service.
- A 301 or 302 redirect that turned a POST into a GET, landing on a POST-only endpoint.
- Server or WAF configuration that blocks methods such as PUT and DELETE.
How to fix a 405 Method Not Allowed
If you sent the request
- Read the Allow header and switch to a supported method.
- Look for a redirect before the 405 in the Network tab; a 301 or 302 can silently turn a POST into a GET.
- Confirm the URL, including any trailing slash, matches the API documentation.
If you run the server
- Add the missing handler, or keep the 405 and make sure the Allow header is accurate.
- Use 308 instead of 301 for redirects on endpoints that accept POST.
- Check web server and WAF rules that restrict methods.
Related status codes
- 501 Not Implemented: The server does not support the method for any resource at all.
- 404 Not Found: The URL itself does not exist, whatever the method.
- 403 Forbidden: The method is valid here, but this client is not permitted to use it.
Tools that help
- cURL Converter turns a curl command with an explicit -X method into fetch or other client code.
Frequently asked questions
The HTTP method used (GET, POST, etc.) isn't supported for this particular resource.
Sending a POST to an endpoint that only accepts GET, or vice versa.
Check the API documentation for the correct HTTP method for this endpoint. The response's Allow header lists the supported methods.
The form is most likely posting to a URL that only accepts GET, such as a static page, or a redirect on the way turned the POST into a GET. Check the form action URL, and look in the Network tab for a redirect before the 405.
Sources
Other 4xx Client Error codes
Reviewed by Raja Jahangir · Last reviewed: October 7, 2026
