WHAT IT DOES
Read the command first. Convert it second.
Paste a curl command and it is read into its parts first: the request, the credential, the headers, the body, how the connection is made, and what happens to the response. The code comes after that, in whichever of eight languages you pick: fetch, requests, net/http, java.net.http, HttpClient, PHP's cURL extension, Net::HTTP, or reqwest. The command is tokenized the way a shell would tokenize it, so quoted headers, escaped bodies, and commands wrapped over several lines survive intact.
Why use it?
A request copied from a terminal or browser often needs to become application code. Converting the syntax is only useful if you also know which behavior the target client can reproduce.
How to use this tool
- Paste a cURL command, using dummy credentials when working on an example.
- Choose the target runtime and convert the command.
- Review the request summary and capability verdicts beside the code before copying it. Test the generated request against a service you control; this page does not send it.
Details and limitations
- Every feature the command uses gets a verdict for the language you picked: reproduced, close but not identical, or not reproduced at all. A proxy is real code in Python and Go and impossible in a browser, and the page says which of those you are looking at.
- The verdicts are what the eight targets actually differ on. PHP is libcurl, so a cookie jar and a unix socket convert exactly; Ruby's Net::HTTP will not follow a redirect, so -L becomes a loop; reqwest is the only one whose redirect policy takes a number, so --max-redirs converts exactly there and nowhere else.
- Quoting follows shell rules: single quotes are literal, double quotes escape only what a shell escapes, and a quoted header stays one argument.
- Line continuations are accepted in all three forms people paste: a trailing backslash, a caret from cmd, and a backtick from PowerShell.
- Where a language keeps a header somewhere unusual, the code puts it there. .NET refuses Content-Type on the request rather than the content, and does it silently, so the generated C# sets it on the content.
- The method is inferred the way curl infers it: -d makes it a POST, -T makes it a PUT, and -I makes it a HEAD, unless -X says otherwise.
- Without -L, curl does not follow redirects, and all three clients do. The generated code turns following off, because that difference is the one that quietly changes what a script reads.
- -H 'Name:' and -H 'Name;' are different instructions. The first suppresses a header curl would generate; the second sends an empty one. Both are carried through to the code, where the language allows it.
- A header written twice stays written twice where the client allows it. fetch gets a list of pairs, Go gets Header.Add, Java and Rust append, PHP sends a list, and Python gets the comma-joined form with a note, because a mapping cannot hold both.
- --data-binary @file names a file curl reads at run time, and the code reads the same file rather than sending the path as text.
- -b takes either a cookie string or a cookie file, and they are told apart the way curl tells them apart: an argument with an = in it is a string.
- Connection flags are carried as far as each client goes: --connect-timeout and --max-time, --retry, -x, -k, --compressed, and the HTTP version flags.
- What happens to the response is part of the command too. -o, -O, -i, -I, -D, -w, -c, and -f all change the code that is generated.
Convert cURL without silently changing request behavior
Read the request before the code
Use the example below in the cURL converter. The data option makes the request a POST even without -X POST. The Content-Type header describes the request body. The example domain is deliberately nonproduction, and the token is a dummy value: do not replace it with a live secret when sharing a screenshot or support report.
curl 'https://api.example.com/items' -H 'Content-Type: application/json' -H 'Authorization: Bearer DEMO_ONLY' --data '{"name":"widget"}'Compare the capability ledger
Choose the runtime in which the code will actually run. The feature verdicts beside the generated code distinguish reproduced behavior from approximations and unsupported features. A browser cannot configure an HTTP proxy or disable certificate verification through fetch. Server clients have different capabilities; copying a request into another language is not evidence that every flag kept its meaning.
Watch redirects and errors
cURL follows redirects when asked with -L. Many client libraries follow by default, so generated code may explicitly turn that behavior off. Browser manual redirects have visibility restrictions; use the converter's warnings rather than assuming a browser can expose the same response that a command-line client can. Likewise, an HTTP 404 and a failed network connection are not interchangeable. Check what the original command does with -f and what the generated client reports.
Verify against a safe endpoint
Before deployment, run the generated code against a test service you control. Compare method, path, request body, repeated headers, redirects, and error handling. The tool does not send the request for you. Local parsing protects the command while using this page, but pasted credentials still enter the clipboard and any generated source file you save. Replace secrets with your application's credential mechanism before committing code.