DEV Community

Discussion on: Build a CRUD Django REST API

Collapse
 
doctorsmonsters profile image
doctorsmonsters

Very nice tutorial. I have been following it to modify my project, but unable to create a new entry in the database. I am getting the following error:

raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It is evoked by the line:
payload = json.loads(request.body)

Any idea what I am doing wrong? I have tried a few fixes but no help.

Collapse
 
itsntox profile image
Ntox

Your request.body is not a JSON format, it's probably a serialized string.