@http · HTTP status codes, explained HTTP/1.1 405 Method Not Allowed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4xx · Client error This URL exists but doesn't support that method. WHAT IT MEANS ──────────────────────────────────────────────────────────── The URL exists, but it doesn't support the request method, such as a DELETE on a read-only resource. The response must include an Allow header listing the methods it does support. WHY YOU'RE SEEING IT ───────────────────────────────────────────────────── → Sending POST to a route that only handles GET, or the other way round. → A form posting to a static file. Static hosts often answer POST with 405. → Missing OPTIONS handling for CORS preflight requests. HOW TO FIX IT ──────────────────────────────────────────────────────────── → Check the method against the API docs or the Allow header. → Make sure the router registers the method you expect, including OPTIONS and HEAD. EXAMPLE RESPONSE ───────────────────────────────────────────────────────── HTTP/1.1 405 Method Not Allowed Allow: GET, HEAD, OPTIONS Content-Length: 0 related 501 Not Implemented   404 Not Found   400 Bad Request spec RFC 9110 §15.5.6 https://www.rfc-editor.org/rfc/rfc9110#section-15.5.6 web https://athttp.com/405 ← curl athttp.com/404 curl athttp.com/406 →