405 Method Not Allowed

This URL exists but doesn't support that method.

4xx · Client error

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