405 Method Not Allowed

HTTP 405 Method Not Allowed is a 4xx client error status. The URL exists but does not support the HTTP method used.

405Status code
4xxClient error
YesCacheable by default
RFC 9110 §15.5.6Defined in

Common causes

What to do

The response must include an Allow header listing supported methods.

Example response

HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD
Content-Length: 0

Returning 405 in code

Express   res.status(405).json({ … });
Flask     return jsonify(…), 405
PHP       http_response_code(405);
Go        w.WriteHeader(405)
nginx     return 405;

Other 4xx codes

Frequently asked questions

What does HTTP 405 mean?
The URL exists but does not support the HTTP method used.
Is 405 an error?
Yes. It is a client error: the request needs to change before retrying.
Does a 405 hurt SEO?
If search engines see it repeatedly on pages that should rank, those pages can be dropped from the index. Fix it quickly.