Why Is My Django Post Request Sending Incorrectly Parsed My List Of Dictionaries?

Here is my Django view:

def sendMail(request):
    url = ''
    dictwithlist = request.FILES['dictwithlist']
    parsed = json.load(dictwithlist)
    // the log file shows that the lists are intact after json.loads
    logip(request, json.loads(parsed))
    x =, json.loads(clockoutJSON))
return HttpResponse(status=204)

If I just send parsed data my express server receives an empty dict, {}. When I log the json.loads(parsed) I find good data, with the lists intact. When the data gets to the other side though, the dictionaries inside the nested list are all removed, replaced by only strings of their keys.

I tried using headers as described here: Sending list of dicts as value of dict with going wrong but I just get 500 errors. I don't know if I'm formatting the headers wrong or not. (because the code has line spacing and I'm copying it)

Can anyone help me understand why this is failing? I need that list to get through with its dictionaries intact.



I believe you may need to use dumps rather than loads when sending the request:

x =, json.dumps(parsed))

Alternatively if you're using the python requests library you can send json as a dict as below:

response =, json=parsed)