Status Code 405

Method Not Allowed

A request method is not supported for the requested resource.

Details

Category

Client Error

Popularity

common

Recommended

Yes

Deprecated

No

Common Use Case

Using POST on a GET-only endpoint

Notes

Standard response for unsupported HTTP methods.

RFC Reference

RFC 9110 HTTP/1.1 (2022)
Defines the HTTP/1.1 protocol, including semantics, caching, and connection management.

Description

A request method is not supported for the requested resource.

HTTP Response Example

A typical server response for a 405 Method Not Allowed status code looks like:

HTTP/1.1 405 Method Not Allowed
Date: Sun, 22 Mar 2026 12:00:00 GMT
Server: httperrors.com
Content-Type: application/json

{
  "error": {
    "code": 405,
    "message": "Method Not Allowed"
  }
}
Detailed Explanation

Client errors are not always signs of a broken application. Many of them are deliberate contract signals that help API consumers, browsers, and operators understand what must change before retrying.

Historically, HTTP 405 Method Not Allowed should be read in light of RFC 9110. Standards text tends to focus on precise semantics, while production systems care about retries, user experience, dashboards, proxies, browsers, and documentation. Good engineering joins those two views instead of choosing one over the other. When teams treat a status code as both a protocol message and a product decision, they produce APIs and pages that are easier to operate and easier to trust.

A practical reading of this entry is that the server is communicating something very specific: A request method is not supported for the requested resource. In day-to-day work, that meaning should be reflected across controllers, reverse proxies, API gateways, and frontend assumptions. If the server sends HTTP 405, but the response body, cache headers, or application behavior tell a different story, client code starts compensating for inconsistency and the whole stack becomes harder to reason about.

The normative anchor here is RFC 9110, with a direct reference at https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.6. That RFC context matters because the exact words in the standard often settle edge cases around caching, retries, authentication, payload requirements, or intermediary behavior.

A useful client error response should do more than fail fast. It should tell the caller enough to correct the request without exposing unnecessary internals or creating security leaks.

In implementation terms, HTTP 405 Method Not Allowed should appear at a deliberate decision point in your request handling code. Avoid choosing it late as a cosmetic label after the rest of the response is already formed. Automatic retries are usually the wrong first move unless the client can correct the original request before sending it again. If your logs show this status frequently, the surrounding context should make it obvious whether the response reflects normal traffic or a design problem.

For HTTP 405 Method Not Allowed, the short description is only the starting point. The more useful interpretation is how a real client should react after seeing this response in a live request cycle. A request method is not supported for the requested resource.

A useful way to compare HTTP 405 is against other 4xx responses that might look similar in dashboards. Choosing the wrong one can blur important distinctions between validation failures, authorization issues, missing resources, and unsupported operations. This is one reason protocol precision pays off over time: the better your status taxonomy, the easier it becomes to debug client behavior, build metrics, and explain edge cases to other engineers.

From an operational perspective, HTTP 405 should be visible in logs, metrics, and alerts with enough surrounding metadata to explain why it happened. Popularity for this entry is listed as common, and that should influence how much defensive documentation and monitoring you add. Because the code is common, it is worth distinguishing healthy uses from suspicious spikes so routine traffic is not mistaken for a regression.

Client error responses tell crawlers that the requested content is unavailable, invalid, restricted, or otherwise not ready to be processed. Used accurately, that helps search engines understand site quality. Used carelessly, it can make healthy content look broken or thin. For HTTP 405, the operational takeaway is that status correctness supports SEO indirectly by making crawl behavior more predictable. Pages, APIs, and edge routes should return this code only when its meaning is exactly true.

Since this code is marked as recommended, teams can confidently use it when the semantics are an exact match. The key word is exact. Recommendation does not mean convenience; it means the code is a strong standard choice when the surrounding conditions line up.

Because this code is not deprecated, it remains part of the active vocabulary that modern web systems can use. Even so, correctness still depends on discipline. A valid status code becomes harmful if teams reuse it as shorthand for several unrelated situations.

The supporting note for this entry is also important: Standard response for unsupported HTTP methods. This often captures the gap between the formal specification and day-to-day engineering practice.

The best way to think about HTTP 405 Method Not Allowed is not as trivia, but as a promise. It tells the caller what happened, what should happen next, and how much confidence the client can place in the current response. The example recorded for this entry is Using POST on a GET-only endpoint, and the note says Standard response for unsupported HTTP methods.. Together with the specification link at https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.6, those details give implementers enough context to use the code intentionally rather than mechanically. That is the standard worth aiming for in production systems.

Other HTTP status codes in the Client Error category

400 Bad Request

The server cannot or will not process the request due to an apparent client error.

Reference: RFC 9110
Example usage:
Malformed request syntax, invalid parameters
Client Error
401 Unauthorized

Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.

Reference: RFC 9110
Example usage:
Missing or invalid authentication credentials
Client Error
402 Payment Required

Reserved for future use. The original intention was that this code might be used as part of some form of digital cash or micropayment scheme.

Reference: RFC 9110
Example usage:
Digital payment systems (rarely used)
Client Error
403 Forbidden

The request contained valid data and was understood by the server, but the server is refusing action.

Reference: RFC 9110
Example usage:
Insufficient permissions, IP blocking
Client Error
404 Not Found

The requested resource could not be found but may be available in the future.

Reference: RFC 9110
Example usage:
Broken links, deleted resources, typos in URL
Client Error
406 Not Acceptable

The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.

Reference: RFC 9110
Example usage:
Client requests XML but server only has JSON
Client Error
407 Proxy Authentication Required

The client must first authenticate itself with the proxy.

Reference: RFC 9110
Example usage:
Corporate proxy requiring authentication
Client Error
408 Request Timeout

The server timed out waiting for the request.

Reference: RFC 9110
Example usage:
Client took too long to send request
Client Error
409 Conflict

Indicates that the request could not be processed because of conflict in the current state of the resource.

Reference: RFC 9110
Example usage:
Version conflicts, duplicate resource creation
Client Error
410 Gone

Indicates that the resource requested is no longer available and will not be available again.

Reference: RFC 9110
Example usage:
Permanently deleted resources
Client Error
411 Length Required

The request did not specify the length of its content, which is required by the requested resource.

Reference: RFC 9110
Example usage:
Missing Content-Length header
Client Error
412 Precondition Failed

The server does not meet one of the preconditions that the requester put on the request header fields.

Reference: RFC 9110
Example usage:
If-Match header conditions not met
Client Error
413 Content Too Large

The request is larger than the server is willing or able to process.

Reference: RFC 9110
Example usage:
File upload exceeds size limit
Client Error
414 URI Too Long

The URI provided was too long for the server to process.

Reference: RFC 9110
Example usage:
URL with too many query parameters
Client Error
415 Unsupported Media Type

The request entity has a media type which the server or resource does not support.

Reference: RFC 9110
Example usage:
Uploading unsupported file format
Client Error
416 Range Not Satisfiable

The client has asked for a portion of the file, but the server cannot supply that portion.

Reference: RFC 9110
Example usage:
Invalid byte range in Range header
Client Error
417 Expectation Failed

The server cannot meet the requirements of the Expect request-header field.

Reference: RFC 9110
Example usage:
Expect: 100-continue not supported
Client Error
418 I'm a teapot

This code was defined in 1998 as one of the traditional IETF April Fools' jokes.

Reference: RFC 2324
Example usage:
April Fools' joke, some services use it humorously
Client Error
421 Misdirected Request

The request was directed at a server that is not able to produce a response.

Reference: RFC 9110
Example usage:
HTTP/2 connection reuse issues
Client Error
422 Unprocessable Content

The request was well-formed but was unable to be followed due to semantic errors.

Reference: RFC 4918
Example usage:
Validation errors in request body
Client Error
423 Locked

The resource that is being accessed is locked.

Reference: RFC 4918
Example usage:
WebDAV locked resources
Client Error
424 Failed Dependency

The request failed because it depended on another request and that request failed.

Reference: RFC 4918
Example usage:
WebDAV dependent operations
Client Error
425 Too Early

Indicates that the server is unwilling to risk processing a request that might be replayed.

Reference: RFC 8470
Example usage:
TLS early data concerns
Client Error
426 Upgrade Required

The client should switch to a different protocol such as TLS/1.3.

Reference: RFC 9110
Example usage:
HTTP to HTTPS upgrade requirement
Client Error
428 Precondition Required

The origin server requires the request to be conditional.

Reference: RFC 6585
Example usage:
Prevent lost update problem
Client Error
429 Too Many Requests

The user has sent too many requests in a given amount of time.

Reference: RFC 6585
Example usage:
Rate limiting, API quotas exceeded
Client Error
431 Request Header Fields Too Large

The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.

Reference: RFC 6585
Example usage:
Cookie header too large
Client Error
451 Unavailable For Legal Reasons

A server operator has received a legal demand to deny access to a resource or to a set of resources.

Reference: RFC 7725
Example usage:
Content blocked due to legal requirements
Client Error

HTTP status code data sourced from official IETF RFCs and standards.

© 2026 The open source reference for HTTP status codes