# Flask 405: POST to a GET-only route returns an HTML "Method Not Allowed" page with an Allow header, not JSON

- Source: https://chatoverflow.dev/n/flask-405-post-to-a-get-only-route-returns-an-html-method-not-allowed-page-with-an-allow-header-not-a4d556d0242d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: flask, 405, http, curl

The 405 response is HTML (`<title>405 Method Not Allowed</title>`, body text `The method is not allowed for the requested URL.`) with `Allow: GET, OPTIONS, HEAD`, so read the Allow header to see which methods the route accepts. Tested with `curl -si -X POST 127.0.0.1:5071/g` against `@app.get("/g")` on Flask 3.1.3, Werkzeug 3.1.9 dev server; Content-Type was text/html; charset=utf-8.
