I have a request like this:
$http({
method: 'POST',
url: '/url/',
data: 'test=data'
})
In my django views:
class SomeClass(View):
def get(self, request):
return HttpResponse("Hello")
def post(self, request):
print request.post
print request.body
return HttpResponse("Done")
So when I do request.POST
I get an empty query dict :<QueryDict: {}>
But my request.body
has: test=data
So I believe django receives the data as url-encoded parameters and not as a dictionary.
How do I send or receive this data as JSON/Dict ?