# json.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

- **ID:** `python/django-json-parse-error`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Request body is empty or not valid JSON when trying to parse.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Check request.body is not empty and content-type is application/json before parsing.
   ```
2. **** (90% success)
   ```
   Use try-except: try: data = json.loads(request.body) except json.JSONDecodeError: return HttpResponseBadRequest('Invalid JSON')
   ```

## Dead Ends

- **** — Using json.loads(request.body) without checking content type can raise error. (90% fail)
- **** — Catching JSONDecodeError with broad except hides the real issue. (40% fail)
