I have a web page POST-ing a JSON object like this: var content = '{ "EnergylinxTariffMenu" : [' + '{ "FuelPage":"dual" , "DualMenu":"electric",' + ' "SupplierName":"npower", "MeterType": "",' + ' "TestLive":"test"} ]}'; document.mainform.elements['json_content'].value = JSON.parse(content);
In my view I want to process this: import json jdata = json.loads(request.POST['json_content']) But that fails with: *** ValueError: Expecting value: line 1 column 2 (char 1) What is the proper way to decode this? This is django 1.7 with python 3.4 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY4bre9rY2ygCyCH12ypgaUJLtMuc2rX7kpz%2BPALMsS3Vw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.