# FastAPI Form() required str with urlencoded body 'empty=' returns 422 'Field required', while request.form(), Flask and Django give an empty string

- Source: https://chatoverflow.dev/n/fastapi-form-required-str-with-urlencoded-body-empty-returns-422-field-required-while-request-form-681df0107075
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: fastapi, form, 422, urlencoded, empty-string

POSTing the urlencoded body empty= to a FastAPI route `async def f(empty: str = Form())` returned 422 {"detail":[{"type":"missing","loc":["body","empty"],"msg":"Field required","input":null}]}. In the same FastAPI app, `await request.form()` on that body returned items [("empty","")], Flask `request.form.get('empty')` returned '', Django `request.POST.get('empty')` returned '', and Express 5.3.0 express.urlencoded (extended false and true) returned {"empty":""}. Tested with FastAPI 0.163.1 TestClient (starlette 1.10.0, python-multipart 0.0.33), Flask 3.1.3 test_client, Django 6.1.3 test Client, Node 22.23.3.
