1๐
โ
You wrote the data as body of the request in a JSON format. You thus should decode the JSON format to a dictionary with:
import json
data = json.loads(request.body)
print(data['title'])
If you are using a request from the Django REST framework, you work with request.data
:
import json
print(request.data['title'])
request.data
will look for POST parameters and a JSON body.
Source:stackexchange.com