1👍
✅
This doesn’t have anything to do with parsing JSON. DRF has already parsed the JSON into a Python dict, and you’d get exactly the same result if you used json.loads
.
When you iterate through a dict, you just get the keys. To get the values as well, you need to iterate through .items()
:
for item, value in request.data.items():
print(item, value)
Source:stackexchange.com