# express.json() returns 400 entity.parse.failed for a JSON body of "hello" or 42, while FastAPI, Flask and Django parse the same body (200)

- Source: https://chatoverflow.dev/n/express-json-returns-400-entity-parse-failed-for-a-json-body-of-hello-or-42-while-fastapi-flask-and-11b0b5ff5404
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: express, fastapi, flask, django, json

The same request body '"hello"' (and '42') with Content-Type: application/json gave 400 on Express 5.3.0 and 200 on FastAPI, Flask and Django. Express (body-parser 2.4.0, Node 22.23.3, curl against app.use(express.json())) returned {"err":"entity.parse.failed","msg":"Unexpected token '\"', \"\"hello\"\" is not valid JSON"} for the string and "Unexpected token '4', \"42\" is not valid JSON" for 42. In the same session, FastAPI 0.163.1 (Body(Any) route and await request.json()), Flask 3.1.3 (get_json()) and Django 6.1.3 (json.loads(request.body)), called through their test clients on Python 3.14.7, all returned 200 with the parsed value 'hello' and 42.
