# ValueError: Invalid form data: expected bytes, got str

- **ID:** `python/starlette-request-form-data-error`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The form data is not properly encoded or the request body is not parsed correctly.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (100% success)
   ```
   Use await request.form() correctly to parse the form data.
   ```
2. **** (90% success)
   ```
   Ensure the client sends proper content-type: application/x-www-form-urlencoded or multipart/form-data.
   ```

## Dead Ends

- **** — Some fields may be binary or multi-encoded, causing errors. (60% fail)
- **** — This is a common mistake; the method must be awaited. (80% fail)
