Skip to content
HTTP errors in web scraping and automation · error message

HTTP: 405 Method Not Allowed

ConfigurationHTTP 405Wrong URL or method (404, 405)

Last verified

The exact message
405 Method Not Allowed

What it means

405 means the URL exists, but not for the HTTP method you used. RFC 9110 requires the server to send an Allow header listing the methods it does accept, for example Allow: GET, HEAD.

In automation this usually appears when a script sends GET to an endpoint the site's front end calls with POST (search forms and GraphQL endpoints are common), or POSTs to a page that only accepts GET. Some servers also answer HEAD requests with 405, which breaks link checkers that use HEAD to save bandwidth.

What is not wrong: your credentials and the URL path. Only the method, and often the body format that goes with it, needs to change.

What it looks like

HTTP/1.1 405 Method Not Allowed
Allow: POST

requests.post(url, json={"query": "shoes"}, timeout=30)

Why it happens

  • Sending GET to a search or API endpoint that requires POST with a JSON or form body.
  • Sending POST to a static page or a route that only serves GET.
  • A link checker using HEAD against a server that does not implement it.
  • A redirect from HTTP to HTTPS that changed POST to GET along the way (301/302 behavior).

How to fix it

  1. Read the Allow header on the 405 response to see the accepted methods.
  2. Check the API documentation, or the network tab of your own browser session, to see which method and body the endpoint expects.
  3. Send the body in the documented format and Content-Type (application/json vs form-urlencoded).
  4. Call the final HTTPS URL directly so redirects do not rewrite the method.
  5. For link checking, fall back from HEAD to GET when you get 405.

How to stop it recurring

Use documented APIs and record the method, URL and body for each endpoint you call. Avoid relying on 301/302 redirects for non-GET requests; target the canonical URL directly.

Official documentation: developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405. See all HTTP error messages.

Related errors

Definitions

Quick answers

What does "405 Method Not Allowed" mean in HTTP?

405 means the URL exists, but not for the HTTP method you used. RFC 9110 requires the server to send an Allow header listing the methods it does accept, for example Allow: GET, HEAD . In automation this usually appears when a script sends GET to an endpoint the site's front end calls with POST (search forms and GraphQL endpoints are common), or POSTs to a page that only accepts GET.

How do I fix "405 Method Not Allowed"?

1. Read the Allow header on the 405 response to see the accepted methods. 2. Check the API documentation, or the network tab of your own browser session, to see which method and body the endpoint expects. 3. Send the body in the documented format and Content-Type (application/json vs form-urlencoded). 4. Call the final HTTPS URL directly so redirects do not rewrite the method. 5. For link checking, fall back from HEAD to GET when you get 405.

Retries and timeouts without writing the loop

Autonoly's HTTP Request node and browser steps have per-node retries, timeouts and continue-on-fail, so a transient 429 or 503 can back off instead of failing the run. It has no proxies or IP rotation: if a site blocks automated traffic, that block applies to Autonoly too.

Also see Error handling in workflows.