HTTP 405 Method Not Allowed

Unsupported HTTP methods and request restrictions

What the 405 Status Code Means

The HTTP 405 Method Not Allowed status code indicates that the server received the request and recognized the target resource, but the HTTP method used in the request is not supported for that resource.

In other words, the URL exists, but the request method such as POST, PUT, or DELETE is not allowed for the requested endpoint.

Common Causes of HTTP 405 Errors

Example of a 405 Response

HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD
Content-Type: text/html

Servers often include an Allow header which lists the HTTP methods supported by the requested resource.

Common HTTP Methods

If a client sends a method that is not supported for a particular resource, the server may return a 405 response.

How Developers Diagnose 405 Errors

Related HTTP Status Codes

Summary

The HTTP 405 Method Not Allowed status code indicates that the server understands the request but does not allow the HTTP method used for the requested resource.

Ensuring that clients use the correct HTTP methods for each endpoint is essential when designing REST APIs and web services.