cURL Converter
Convert cURL commands to JavaScript fetch, Axios, Python requests, and PHP code.
JavaScript (fetch)
JavaScript (Axios)
Python (requests)
PHP (cURL)
PHP (Guzzle)
cURL command
curl -X POST https://api.example.com/v1/users \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -d '{"name":"Ada Lovelace","email":"ada@example.com","admin":false}'
JavaScript (fetch)
Copy
const response = await fetch("https://api.example.com/v1/users", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_TOKEN", }, body: JSON.stringify({ "name": "Ada Lovelace", "email": "ada@example.com", "admin": false }), }); const data = await response.text(); console.log(data);