cjahangir cjahangir - 1 year ago 150
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download