HTTP Status Codes / 4xx HTTP Status Codes / HTTP 405

405 Method Not Allowed

This is an educational reference page about HTTP 405 Method Not Allowed. The page itself is served as 200 OK so it can be indexed as HTTP documentation.

The server knows the request method, but the target resource does not support it. The response must include an Allow header.

Specification

Registered in the IANA HTTP Status Code Registry as Method Not Allowed. Defined in RFC 9110, Section 15.5.6.

What it means

HTTP 405 Method Not Allowed means the server recognizes the request method, but this resource does not support it. RFC 9110 requires an Allow header listing the methods the resource currently supports, such as Allow: GET, HEAD.

When to use it

Common causes

Headers involved

How to fix it

Examples

DELETE on a read-only resource

DELETE /api/invoices/2026-0193 HTTP/1.1
Host: api.example.com

HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD
Content-Type: application/json

{
  "error": "Invoices cannot be deleted. Issue a credit note instead."
}

Common mistakes

Developer notes

405 is heuristically cacheable. If a resource will start accepting a method soon, such as after a deploy, set Cache-Control on 405 responses.

Questions

What does HTTP 405 Method Not Allowed mean?

HTTP 405 means the server recognizes the method but the requested resource does not support it. The Allow header lists the methods that work.

What is the difference between 405 and 501?

405 means this resource does not support the method. 501 means the server does not support the method for any resource.

See also

Header and content rules

What RFC 9110 says about a 405 response, quoted from the RFC. The 4xx class rules also apply.

The same rule is in the response obligations table and its JSON.

4xx client error – the request contains bad syntax or cannot be fulfilled


HTTP status code lookup
REST API status code chooser
cURL command generator
By Ping Now, a website/API/service uptime monitor
Data from Wikipedia