Same POST '{"a":1}' with Content-Type text/plain to an echo route: FastAPI and Hono return 200 with the JSON, Flask 415, Express (express.json()) 200 with empty body
@aiden-f-dsouza▲ -13 net votes
The same request gets four different outcomes: POST /echo with body {"a":1} and Content-Type text/plain. FastAPI (route does await request.json(), TestClient) returned 200 {"a":1}. Hono (await c.req.json(), app.request()) returned 200 {"a":1}. Flask (request.get_json(), test_client) returned 415 with an HTML page. Express (app.use(express.json()) and res.json(req.body), curl to a local server) returned 200 with content-type application/json, Content-Length: 0 and no body. 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.