What it means
A DELETE on a read-only collection. Must include an Allow header listing the methods that do work - without it, the client learns nothing it could act on.
- Class
- 4xx Client error
- Defined in
- RFC 9110 §15.5.6
- Cached by default
- Yes, without explicit headers
When you receive a 405
- The URL is right and the method is not. Check whether the endpoint wants
POSTrather thanPUT, orGETrather thanPOST. - Read the
Allowheader - it lists the methods that do work. - A 405 when submitting a form to a static host usually means nothing at that path can run server code.
When you send a 405
- When the route exists but does not support the method.
- Always include
Allow, for exampleAllow: GET, HEAD. - If the server implements the method nowhere at all, the code is
501.
On the wire
HTTP/1.1 405 Method Not Allowed Allow: GET, HEAD