- Home
- Tools
- Developer Tools
- HTTP Status Codes
- 405 Method Not Allowed
405 Method Not Allowed
The address exists but doesn't accept this method, such as a POST to a page that can only be read. The Allow header lists what works.
- Class
- 4xx Client error. The request is the problem: a wrong address, missing credentials, data the server can't accept.
- Defined in
- RFC 9110
What it looks like
HTTP/1.1 405 Method Not Allowed Allow: GET, HEAD
What causes it
When the server knows the method but doesn't support it for this resource: a DELETE on a collection that is read-only, a POST to a static file, a GET to an address that only takes POST. The response has to include an Allow header with the methods that are accepted.
What to do about it
Compare the method you sent with the Allow header and with the documentation of the API.
Two common causes lie outside your own code. One is a redirect on the way that turned your POST into a GET, visible as a 301 or 302 just before the 405. The other is a form that posts to a static page or to the wrong address.
Not to be confused with
| 501 Not Implemented | The server doesn't know the method at all, for any address. |
|---|---|
| 404 Not Found | The address itself doesn't exist. |
| 403 Forbidden | The method is fine, but you are not allowed. |
All codes are on the list of HTTP status codes, which can be searched by number and by word.
Other 4xx codes
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 424 Failed Dependency
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons