Skip to content

Curl To Code API

POST https://api.findutils.com/api/tools/curl-to-code/execute

Returns source code that performs the same HTTP request as a cURL command, in JavaScript (fetch), Python (requests), PHP (cURL), Go (net/http), Ruby (net/http) or Node.js (https). Also returns the parsed request: method, URL, headers, body and basic auth. Parses -X, -H, -d/--data/--data-raw/--data-binary, -F/--form (name=value only; file fields are rejected), -u and the URL.

Request body

application/json
  • curl_command

    string required

    The cURL command, e.g. "curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{"a":1}'". Line continuations (backslash-newline) are accepted. Simple -F name=value fields become multipart POST. File fields such as -F file=@photo.png are rejected.

  • language

    string optional

    Target language. Default: "javascript". One of javascript · python · php · go · ruby · node. Default "javascript".

Example arguments

Verified
{
  "curl_command": "curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{\"name\":\"John\"}'",
  "language": "javascript"
}