I’m sending an Ajax request (with jQuery) with structured post data:
$.post(
myUrl,
{
items: [{code: 'a', description: 'aaa'},
{code: 'b', description: 'bbb'}]
})
what I see in request.POST is:
<QueryDict: {u'items[0][code]': [u'a'],
u'items[0][description]': [u'aaa'],
u'items[1][description]': [u'bbb'],
u'items[1][code]': [u'b']}>
How can I process the request to obtain the original items?
(Note that request.POST.get('items') doesn’t work)
I made special library for Django/Python to handle structured data sent through requests. You can find it on GitHub here.