// Paste a cURL command on the left
// Paste a cURL command on the left
Copy a request out of your browser DevTools and get working code for it. Paste the cURL command; get fetch, axios, Python requests or Go, plus a plain-language breakdown of what the command actually sends.
A curl command from browser DevTools or an API document carries everything a request needs, in a shell syntax that does not paste into a program. Translating it by hand is where headers get dropped and a JSON body gets its quoting mangled.
This converts a curl command into fetch, axios, Python requests or Go, keeping the method, headers, query parameters and body intact — including the multi-line quoting that "Copy as cURL" produces. Authorization headers and cookies come across as-is, which is worth remembering before pasting the output into somewhere shared.
The value of Copy as cURL is that it captures a request that actually worked, headers and all. That is also its risk: the command it produces carries every cookie the browser sent, any Authorization header, and session identifiers that are live until they expire. Pasting one into a chat, a ticket or a public issue hands over whatever those credentials open. The same applies to output generated from it here — the translated code contains the same values, and stripping them is worth doing before the snippet goes anywhere shared.
Shell quoting is where hand translation usually goes wrong. A JSON body inside single quotes is literal, so a dollar sign or a backtick inside it means nothing; the same body in double quotes is expanded by the shell before curl ever sees it. Multi-line commands joined by backslashes have to be reassembled before parsing, and Windows uses a different continuation character and different quoting rules again, which is why a command copied on one machine sometimes fails on another. Parsing the command properly rather than pattern-matching it is what keeps a body intact through the conversion.
Each target language has a shape of its own that a mechanical translation should respect. fetch does not set a JSON content type for you and does not throw on a 4xx or 5xx response, so the generated code checks the status explicitly. axios parses JSON and rejects on error status by default, which is the opposite convention. Python requests takes json= rather than a hand-serialised string, and Go needs an explicit request object with its body wrapped in a reader. The output follows each of those instead of transliterating curl flags one for one.
No. Parsing and code generation happen entirely in your browser, so an Authorization header in a pasted command never leaves your machine. Still be careful about pasting production tokens into any tool, including this one.
-F/--form fields are parsed and emitted as FormData for JavaScript targets and as files= for Python. Actual file contents cannot be reproduced from a cURL command, so you will need to attach the file in code yourself.
So you can see what is being encoded and swap in variables. For Python and Go the idiomatic form is used instead — auth=() and req.SetBasicAuth().