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

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

## Root Cause

The view is trying to parse request.body as JSON but the request body is empty or not valid JSON.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Check if request.body is empty before parsing: if not request.body: return JsonResponse({'error': 'Empty body'}, status=400)
   ```
2. **** (90% success)
   ```
   Wrap json.loads in try-except and return 400 with error message.
   ```

## Dead Ends

- **** — Hides the actual error and makes debugging difficult; still fails for malformed input. (80% fail)
- **** — request.POST only parses form data, not JSON payloads, so it will be empty. (90% fail)
