What is the best way to convert the below curl post into python request using the requests module:
curl -X POST https://api.google.com/gmail --data-urlencode json='{"user": [{"message":"abc123", "subject":"helloworld"}]}'
I tried using python requests as below, but it didn't work:
payload = {"user": [{"message":"abc123", "subject":"helloworld"}]}
url = https://api.google.com/gmail
requests.post(url, data=json.dumps(payload),auth=(user, password))
Can anybody help.
urlvariable to be a string, not just some url. Surround it with"