devopscodepro
Language
Runs entirely in your browser — nothing leaves this page.

curl → code

Paste a curl command — from API docs or browser devtools — and get working Go, Python or Node.js code with headers, body and auth carried over.

Paste a curl command above to generate code.

From a copied command to code that ships

Every API doc gives you a curl example, and every browser lets you copy a request as curl. This converts that command into idiomatic code: Go with net/http, Python with requests, Node.js with the built-in fetch — method, URL, headers, body, basic auth, multipart fields and redirect behaviour all carried over.

The parser understands the flags that actually appear in the wild: -X, -H, every -d variant plus --json, -F for multipart, -u, -k, -L, --compressed, devtools' quoting and multi-line backslash continuations. Anything it recognizes but drops (like -o) and anything it doesn't know is listed under the output — nothing disappears silently.

Why does the generated code not set Accept-Encoding for --compressed?

Because the clients do it themselves: Go's transport, requests and fetch all negotiate gzip transparently and decompress the response. Setting the header manually in Go actually disables the automatic decompression — the flag is noted and deliberately not translated.

Is my pasted command sent anywhere?

No. Parsing and code generation run entirely in your browser — commands with bearer tokens and cookies in them never leave the page, which is exactly why this isn't a server-side tool.

What happens with -k / --insecure?

It is translated faithfully — InsecureSkipVerify in Go, verify=False in Python, NODE_TLS_REJECT_UNAUTHORIZED=0 in Node — and each carries a dev-only comment. If the target's certificate fails validation in production, fix the chain, don't ship the flag.

Why does the Python version add allow_redirects=False for GET?

curl does not follow redirects unless you pass -L, but requests follows them by default. The generated code reproduces what your curl command actually did; add -L and the parameter disappears.

Related tools: HTTP headers, JWT decoder and Base64.