Skip to content Skip to sidebar Skip to footer

How To Fix While Make A Post In Python?

I kept getting in my terminal while running the script. I have tried import requests import json url = 'http://172.19.242.32:1234/vse/account' data = '{

Solution 1:

Change

r = requests.post(url, data=json.dumps(data), headers=headers)

to

r = requests.post(url, data=data, headers=headers)

because data is not a dict that must be transformed to json but is already json.

Post a Comment for "How To Fix While Make A Post In Python?"