$ python3 >>> import requests >>> d = {'spam': 20, 'eggs': 3} >>> requests.post("http://localhost:8765", data=d) ^C >>> import json >>> j = json.dumps(d) >>> requests.post("http://localhost:8765", data=j) ^C