405 Method Not Allowed

All status codes
4xx · Client errorterminal

405Method Not Allowed

A request method is not supported for the requested resource; for example, a GET request on a form that requires data to be presented via POST.

What this code obliges you to do

Retry

Do not retry automatically

Repeating the same request produces the same result. A retry loop here just multiplies load and hides the real fault.

Caching

Cacheable by default

RFC 9110 lists this code as heuristically cacheable, so a cache may store it even with no Cache-Control header. Send explicit headers if that is not what you want.

Response body

Body allowed

You may return a payload explaining the outcome — for an error, a machine-readable problem document is worth the effort.

What usually causes it

2
1

Hitting a POST-only API with a GET request in browser

2

REST routing errors

Effect on search

Neutral. Typically happens to bots submitting forms. Real pages should always support GET.

How to send it

1
Go
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)

Codes people confuse with this one

1
Class4xx
RetryNo
CacheDefault
BodyAllowed