convert curl to fetch, axios, python requests
// converted output appears here
curl -sX POST 'https://api.whittly.dev/v1/curl/convert' \
-H 'Authorization: Bearer $WHITTLY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"curl":"curl -X POST https://api.example.com -H 'Content-Type: application/json' -d '{}'","target":"fetch"}'
const res = await fetch('https://api.whittly.dev/v1/curl/convert', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ curl: "curl -X POST ...", target: "fetch" }),
});
const data = await res.json();
const { data } = await axios.post(
'https://api.whittly.dev/v1/curl/convert',
{ curl: "curl -X POST ...", target: "fetch" },
{ headers: { Authorization: 'Bearer ' + apiKey } }
);
curl is the universal command-line HTTP client — developers use it to test APIs, share reproducible requests, and document API calls. This tool parses any curl command and converts it to the equivalent code in JavaScript fetch, Axios, Python requests, or HTTPie.