I am trying to make a REST Api in Django by outputting Json. I am having problems if i make a POST request using curl in terminal. The error i get is
Another scenario can raise the exact error, not related to either csrf or APPEND_SLASH solution, below an example.
def post(self, request, *args, **kwargs):
data= request.data
print(data['x'])
If 'x' does not exist in the payload body, the data['x'] will raise an error, this error in my case gave a false message like the above one. Hopefully, this will help other developers.