At One Place

HTTP 405 — Method Not Allowed

HTTP 405
Method Not Allowed
The URL exists, but it does not accept the HTTP method you used.

What 405 actually means

The resource is real; the verb is wrong. Sending POST to an endpoint that only reads, or DELETE to something the server will not let you remove, produces a 405. The response must include an `Allow` header listing the methods that are accepted, which makes this one of the more diagnosable errors — if the header is there, it tells you exactly what to send instead.

Common causes

  • A POST sent to a route defined only for GET, or vice versa
  • A form with the wrong `method` attribute
  • PUT, PATCH or DELETE disabled at the web server or WAF level
  • A trailing-slash redirect converting a POST into a GET, so the POST route never sees it
  • An OPTIONS preflight blocked by server configuration, breaking CORS

If you're just trying to view the page

  1. Rarely anything you can fix — this is a mismatch between the site's code and the request it made
  2. Go back and use the site's own links or buttons rather than a saved or edited URL
  3. Report it to the site owner; a 405 on a normal page is a genuine bug on their end

If it's your site

  1. Send the `Allow` header — it is required, and without it the client cannot tell what to do
  2. Check the route definition for the method you meant to register
  3. Look for redirects between the client and the handler: a 301 from `/path` to `/path/` will turn a POST into a GET in most browsers, so use 307 or 308 if it must survive
  4. Verify that WebDAV methods or PUT/DELETE are not blocked by a module or a security policy
  5. Handle OPTIONS explicitly for CORS endpoints rather than letting the framework reject it

Reference

Status code
405
Reason phrase
Method Not Allowed
Category
4xx — Client Error
Cacheable by default
Yes
Defined in
RFC 9110 §15.5.6

Common questions

What does HTTP 405 mean?
The URL exists, but it does not accept the HTTP method you used. The resource is real; the verb is wrong. Sending POST to an endpoint that only reads, or DELETE to something the server will not let you remove, produces a 405.
How do I fix a 405 error?
Rarely anything you can fix — this is a mismatch between the site's code and the request it made
Is 405 a client error or a server error?
405 is in the 4xx range, which means client error. The request itself was the problem, so retrying it unchanged will usually return the same code.

Related pages

Sources

  1. Hypertext Transfer Protocol (HTTP) Status Code Registry — IANA
  2. RFC 9110: HTTP Semantics — IETF

How these figures are compiled and checked