← All tools

cURL to Python

Convert cURL commands to Python requests code.

Advertisement
import requests

url = "https://api.example.com/data"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer TOKEN123",
}
payload = {
    "name": "tichi",
    "age": 22
}

response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.text)
Advertisement

More tools

Explore other free utilities.

Advertisement