Note because it was convenient https://curl.trillworks.com/
If you have the following curl
curl -X POST 'https://example.com/' \
-H 'Content-Type: application/json' \
-d '{"key1": "value1", "key2": "value2"}'
If you put this in, it will be converted to the following
import requests
headers = {
'Content-Type': 'application/json',
}
data = '{"key1": "value1", "key2": "value2"}'
response = requests.post('https://example.com/login', headers=headers, data=data)
Recommended Posts