HTTP 405 Method Not Allowed

Status code 405 · Class 4xx

HTTP

Method Not Allowed

Also searched as: error 405, HTTP 405, 405 method not allowed

HTTP request chain from browser through CDN and proxy to the origin server
HTTP errors: find which hop in the request chain failed and read its logs.

What it means

The server knows the URL but does not accept the HTTP method used, for example a POST sent to an endpoint that only allows GET. Visitors see it when submitting forms to misconfigured pages; developers see it when calling APIs with the wrong verb.

Applies to: REST APIs, nginx, Apache, IIS

How to fix HTTP 405 Method Not Allowed

  1. Reload the page normally instead of resubmitting a form
  2. API clients: check the documentation for the correct method and look at the 'Allow' response header, which lists allowed methods
  3. Make sure the URL is exact; a missing or extra trailing slash can route a POST to a static file handler
  4. If you own the site: check that your route or controller defines the method, and that a redirect (301/302) is not turning a POST into a GET
  5. If you own the site: on nginx, POST to a static file returns 405; route the request to the application instead
  6. If you own the site on IIS: check that WebDAV is not intercepting PUT and DELETE requests

Why it happens

RFC 9110 requires 405 when the method is known but not supported by the target resource, and the server must list valid methods in an Allow header. Routing mistakes, static-file handlers and WebDAV modules are common causes.

FAQ

Why does my form submission return 405?

The form posts to a URL that only allows GET, often a static page or a route without a POST handler.

Related errors

Source: IANA HTTP Status Code Registry · fixes written and reviewed by the editors (see our editorial policy)

Last updated: