I have a fairly complicated dictionary that I want to convert into a JSON object.
dataj = json.dumps(post_data)
I get the following error:
TypeError: 6 is not JSON serializable
However, if I print my dictionary:
print post_data
And I copy/paste this post_data back into the same variable:
post_data = pasted data
Json.dumps works. No idea why this is happening but I suspect it has something to do with proper line breaks when copying the text and pasting it back in. Any way I can avoid having to do this?