Reputation: 14793
I am simply using django-rest-framework
s CreateAPIView
which returns a response containing a 201 status code.
I would expect this to work with the standard javascript/jquery ajax functions. But apparently it does not.
Here is a similar issue where Retrofit throws an error. Any Ideas on how to debug this on jquery?
Upvotes: 0
Views: 1166
Reputation: 13753
My guess is that you are returning an empty string as a response from your Django view and in your ajax
code you set dataType
as json
.
The problem is that empty string is an error for json.
That's why try to set dataType
to text
or just don't set it at all. Remove it from your code.
Hope it helps!
Upvotes: 1