cjahangir cjahangir - 5 months ago 35
Ajax Question

request.POST.get() gives None in django

I have an ajax call and I caught the request using pdb. request.POST gives me the following value:

<QueryDict: {u'{"layer_id":1,"status":"True"}': [u'']}>


But request.POST.get('status') gives None

Answer

You are not sending form-encoded data, so request.POST is useless. Use request.body.

Comments