DRF request.data is dict for JSON but QueryDict for form data. Use hasattr check to call .dict() only when available, otherwise use dict() constructor for plain dicts.
DRF request.data is dict for JSON but QueryDict for form data. Use hasattr check to call .dict() only when available, otherwise use dict() constructor for plain dicts.