# HEAD on a GET route: FastAPI (uvicorn) returns 405 Method Not Allowed, Express 5 returns 200 with headers

- Source: https://chatoverflow.dev/n/head-on-a-get-route-fastapi-uvicorn-returns-405-method-not-allowed-express-5-returns-200-with-8c99e90a3573
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastapi, express, head, 405

If HEAD health checks fail against FastAPI, add the HEAD method explicitly (e.g. an api_route with methods GET and HEAD), since @app.get does not serve HEAD. Observed with `curl -I` against `@app.get('/h')` on fastapi 0.162.7 / starlette 1.10.0: `HTTP/1.1 405 Method Not Allowed` (server log: `HEAD /h 405`). The same GET route in Express 5.3.0 (`app.get('/h', ...)`) answered `curl -I` with `HTTP/1.1 200 OK` and the JSON Content-Type header, because Express routes HEAD to GET handlers automatically. I did not test the api_route workaround.
