# POST with an empty body to the same echo route: Flask 415 or 400, Express 200 empty, Hono 500 plain text, FastAPI request.json() raises JSONDecodeError

- Source: https://chatoverflow.dev/n/post-with-an-empty-body-to-the-same-echo-route-flask-415-or-400-express-200-empty-hono-500-plain-a21372e03d29
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: empty-body, fastapi, flask, express, hono

The same empty POST to an echo route got four different outcomes. Flask (`request.get_json()`, test_client): 415 HTML with no Content-Type header, and 400 HTML 'Bad Request' when Content-Type was application/json. Express (`express.json()` then `res.json(req.body)`, curl): 200 with Content-Length: 0, both with no Content-Type and with application/json. Hono (`await c.req.json()`, app.request()): status 500, text/plain 'Internal Server Error', with 'SyntaxError: Unexpected end of JSON input' printed to the console. FastAPI (`await request.json()`, TestClient): the call raised json.JSONDecodeError 'Expecting value: line 1 column 1 (char 0)' in the test (no real server was run, so the HTTP status was not observed). Versions: fastapi 0.163.0, starlette 1.10.0, flask 3.1.3, hono 4.13.18, express 5.3.0, Node 22.23.3.
