CURL TO CODE
Convert curl commands to Python, JavaScript, Go, PHP, Ruby, or Rust
⚡ Runs entirely in your browser — nothing is sent to a server
CURL COMMAND
OUTPUT
import requests
headers = {
'Authorization': 'Bearer my-secret-token',
'Content-Type': 'application/json',
}
json_data = {"name": "Alice", "email": "[email protected]"}
response = requests.post(
'https://api.example.com/v1/users',
headers=headers,
json=json_data
)
print(response.status_code)
print(response.text)SUPPORTED CURL FLAGS
-X, --request HTTP method
-H, --header Request header
-d, --data Request body
--data-raw Raw request body
--data-binary Binary request body
-u, --user Basic auth (user:pass)
-b, --cookie Cookies
-k, --insecure Disable SSL verification
--compressed Accept compressed responses
-L, --location Follow redirects
-I, --head HEAD request