cURL ↔ fetch ↔ Python converter
Paste a cURL command. Convert to JavaScript fetch, Python requests, or HTTPie. Multi-line \ continuations and single/double quotes both supported.
const res = await fetch("https://api.example.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer abc123",
},
body: "{\"name\":\"Mark\",\"role\":\"qa\"}",
});
const data = await res.json();›How to use
- Paste a cURL command on the left (supports
\line continuations and both quote styles). - Pick a target on the top-right: fetch (JS), Python requests, or HTTPie.
- Copy the generated code to your project.
Tips
- Supported flags:
-X-H-d--data-raw--data-urlencode-u-A-b-G. Unrelated flags (-k-s--compressed) are silently ignored. - fetch output uses await / async — wrap it in an async function when you paste it in.
Related tools
- JWT decoder / generatorDecode header / payload / expiry, re-sign with secret
- CSS / XPath selector testerPaste HTML + selector → live highlight of matches
- Regex builder & live testerPattern + sample text → live highlight + capture groups
- Mock API designerDesign endpoints → export Mockoon / Playwright / Postman / json-server config