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
Do not retry automatically
Repeating the same request produces the same result. A retry loop here just multiplies load and hides the real fault.
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.
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
2Hitting a POST-only API with a GET request in browser
REST routing errors
Effect on search
Neutral. Typically happens to bots submitting forms. Real pages should always support GET.
How to send it
1http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)