405 Method Not Allowed

The URL exists but does not support the HTTP method that was used.

Status

HTTP/1.1 405 Method Not Allowed

Details

405 confirms the resource is there and rejects the verb. A collection endpoint that accepts GET and POST answers 405 to a DELETE. The response must include an Allow header listing the methods that are supported, which is the difference between a helpful 405 and a frustrating one.

It also shows up when infrastructure rather than the application refuses the method: static file servers reject POST to a file, and some CDNs and WAFs block PUT, PATCH, or DELETE at the edge before the origin ever sees them.

Headers

Common causes

How to fix it

As the client

As the server

Examples

DELETE /api/v2/order HTTP/1.1
Host: api.example.com

HTTP/1.1 405 Method Not Allowed
Allow: GET, POST
Content-Type: application/json; charset=utf-8

{"error":"method_not_allowed","allowed":["GET","POST"]}

Specifications

RFC 9110 §15.5.6

See also