Unexpected end of JSON

I have a django view for PUT method that returns JSON response as following:

return JsonResponse({'foo':'bar'}, safe=False, status=204)

When I fetch result from javascript and try to convert response to json using

.then(response => response.json())

It gives error: Unexpected end of json input.

Back to Top