Turn a cURL command into the language you actually write
A cURL command copied out of the browser devtools is the most common way developers discover an API. Converting it by hand is tedious and easy to get wrong, especially the body and the header casing.
- Targets
- 8 languages
- Handles
- Headers, body, cookies
- Runs
- In your browser
Measured on Apple M4 Max: 3 µs parse a command into a request model (One command, 2 headers, JSON body) See the benchmarks
How to use it
- Paste the command A full command with flags, or a URL on its own. The parser understands the short and long forms of the common flags.
- Pick a target JavaScript fetch, Python requests, Go, PHP, Ruby, Rust, HTTPie or a plain fetch on the command line.
- Copy the result Headers, the request body, the method and the cookies are carried over. Values that need escaping are escaped.
Reference
One command, three targets
| Target | Output |
|---|---|
| `fetch` | `await fetch(url, { method, headers, body })` |
| `requests` | `requests.post(url, headers=..., json=...)` |
| `httpie` | `http POST url "Key: value" key=value` |
Questions people ask
Which languages are supported?
JavaScript fetch, Python requests, Go net/http, PHP cURL, Ruby net/http, Rust reqwest, HTTPie and a plain curl with the flags tidied up.
Does it handle the request body?
Yes. A --data payload is carried across, and when it parses as JSON it is emitted as a JSON body rather than as a raw string.
What about cookies and authentication flags?
A -b cookie string becomes a cookie header, and -u user:password becomes basic authentication in the target language.
Does it keep my headers exactly?
It keeps the header names and values, lower-casing the names for consistency. Duplicate headers of the same name are preserved as a list where the target language supports it.
Is the command uploaded anywhere?
No. The conversion runs in the browser, which matters because a cURL command copied from a browser almost always contains a live token.
Why did it not recognise my flag?
The parser covers the flags that appear in real commands. An unusual flag is reported as unsupported rather than being dropped silently, so you can see what was missed.
Where this earns its keep
Documenting an API
A README that shows the request in curl and in three client languages is far more useful than one that shows only curl, which most people cannot read.
Debugging a client library
When a request works in curl and fails in your client, the difference is usually the body encoding or a header the library normalised. Comparing the two side by side finds it.
Migrating between runtimes
Moving a script from a shell to Node or Python, and needing the request in the new language without retyping it.
Details that catch people out
A cURL command with --data carries a raw string. Whether that string is JSON, form-encoded or plain text determines the right call in the target language, and the tool infers JSON when the payload parses as JSON and falls back to a raw body otherwise.
HTTP header names are case-insensitive, so --header "content-type: application/json" and "Content-Type" mean the same thing. The converter lower-cases them for consistency, which is what most HTTP libraries do internally anyway.
The cURL command often carries a token
A command copied from the devtools usually includes an Authorization header with a live bearer token. Converting it on a server means sending that token to a third party, where it lands in a log. Converting it in the tab does not.
- The command never leaves your browser.
- Eight targets, including the ones people actually use.
- The body, headers and cookies are carried over.
- A bearer token in the command is not transmitted anywhere.
Guides that go deeper
- Cache-Control and ETag, Explained 9 min read · How HTTP caching works: what Cache-Control directives mean, what an ETag is, what Vary…
Last reviewed 2026-10-16. Every tool on DevSnap runs entirely in your browser, so whatever you paste here never reaches a server.