# fastapi.exceptions.RequestValidationError: value is not a valid dict (type=type_error.dict)

- **ID:** `python/fastapi-form-data-required`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Sending form data but endpoint expects JSON, or vice versa.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 0.100.x | active | — | — |
| 0.110.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   from fastapi import Form
@app.post('/login')
async def login(username: str = Form(...), password: str = Form(...)):
   ```
2. **** (90% success)
   ```
   For JSON: `Content-Type: application/json`; for form: `application/x-www-form-urlencoded`.
   ```

## Dead Ends

- **** — If server expects form, JSON still fails. (60% fail)
- **** — Still expects JSON. (80% fail)
