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
- Rarely anything you can fix — this is a mismatch between the site's code and the request it made
- Go back and use the site's own links or buttons rather than a saved or edited URL
- Report it to the site owner; a 405 on a normal page is a genuine bug on their end
If it's your site
- Send the `Allow` header — it is required, and without it the client cannot tell what to do
- Check the route definition for the method you meant to register
- 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
- Verify that WebDAV methods or PUT/DELETE are not blocked by a module or a security policy
- 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
- 404 Not Found The server is reachable and working, but there is nothing at the address you ask
- 403 Forbidden The server understood the request and is refusing to allow it, and logging in wi
- 401 Unauthorized You need to authenticate, and either you did not or your credentials were reject
- 429 Too Many Requests You have sent more requests than the service allows in a given period.
- 400 Bad Request The server could not understand the request because something about it is malfor
- 413 Content Too Large The request body is bigger than the server is willing to accept.
- 422 Unprocessable Content The request is well-formed and understood, but the data in it fails the rules.
- 409 Conflict The request cannot be completed because it clashes with the current state of the
- 415 Unsupported Media Type The server will not accept the format of the body you sent.
- 408 Request Timeout The server gave up waiting for the client to finish sending its request.
- 410 Gone The resource was deliberately removed and is not coming back, and there is no fo
- 451 Unavailable For Legal Reasons The content is blocked because of a legal demand — a court order, takedown notic