cjahangir
cjahangir

Reputation: 1797

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

Upvotes: 1

Views: 1665

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599460

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

Upvotes: 3

Related Questions