cURL to code
curl_to_codeConvert curl commands into JavaScript fetch, axios, Python requests, PHP cURL, Go, or Node.js code and return a parsed request summary without sending the request.
Instructions
Convert a curl command (bash/zsh quoting incl. $'…', line continuations, "Copy as cURL" from browsers) into code for JavaScript fetch, axios, Python requests, PHP cURL, Go net/http or Node.js http/https: every target the website supports. Understands -X, -H, -d/--data-raw/--data-binary/--data-urlencode, --json, -F forms and files, -u, -b, -A, -e, -G, -I, -k, -L, -m, --connect-timeout, -x, -T, --compressed, --oauth2-bearer. Also returns the parsed request (secrets masked unless revealSecrets) and notes on what could not be converted. Only parses text; never sends the request. Web version: https://s3eidat.github.io/curl-convert/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | No | Optional: write the code to this file (single language only). | |
| command | Yes | The curl command, e.g. "curl -X POST https://api.example.com -H 'Content-Type: application/json' -d '{"a":1}'". | |
| language | No | Target: fetch (browser/Node fetch), axios, python (requests), php (cURL), go (net/http), node (http/https), or "all". | fetch |
| revealSecrets | No | Show Authorization/Cookie/API-key header values and the basic-auth password in the parsed summary (the code always contains them). |