I am POST-ing to a view in Django. The POST body contains data in the following format :
{
'Service' : 'API'
}
and I am doing this in my view :
args = request.POST
service = args.get('Service', '').strip()
But service
comes out as ''
I used pdb and request.POST
is like this :
<QueryDict: {u"{\n 'Service' : 'API'\n}": [u'']}>
Thats the reason service
becomes ''
because it has become a dict-in-a-dict. I want to know is this supposed to happen? What is the [u'']
. From where does it get added in to the body? If it is something that should happen, how do I parse the body to get out Service
?