Review a cURL Conversion Before Replaying It
The cURL converter gives you a request sketch, not a finished test. A simple POST exposes an invalid Python boolean in generated output.

Paste a sanitized request into the cURL Converter when you need a code sketch in another language. Check every generated line before running it. A JSON boolean in the current Python output exposes why.
A browser’s “Copy as cURL” command is often the quickest way to identify the request behind a failing checkout. It is also a snapshot full of disposable headers, rotating tokens, and perhaps customer data. Redact those first. The converter parses a limited set of cURL flags; it does not turn a captured request into a complete API test.
Try a harmless POST first
Paste this synthetic command into the cURL Command box:
curl -X POST https://api.example.test/orders -H "Content-Type: application/json" -d '{"paid":true}'
Try this in cURL to Code
The live page reported POST, one header, the URL, and the JSON body. Selecting JavaScript produced:
const response = await fetch("https://api.example.test/orders", {
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": JSON.stringify({
"paid": true
})
});
const data = await response.json();
console.log(data);
The generated code is a replay sketch. It assumes the reply is JSON and prints it; it does not assert the status, schema, or order invariant. Add those yourself after confirming what this endpoint promises.
One output that needs repair
Select Python for the same input. The live result included:
payload = {
"paid": true
}
response = requests.post("https://api.example.test/orders", headers=headers, json=payload)
Python needs True, not JSON’s lowercase true. The generated Python parses, but evaluating payload raises NameError before the request is sent. If you need Python, replace JSON booleans and nulls with Python literals, then run the result only against a harmless stub or test endpoint. The converter also handles only its explicitly parsed flags; a complex multipart upload or command with shell expansion deserves a manual rewrite.
There is a second trap in the JavaScript sample: response.json() will fail on a successful 204 response because there is no body to parse. Branch on the status and content type in real test code.
Use conversion for the request shape
Use the converter when you have a sanitized, ordinary GET or JSON POST and want to inspect how headers and body map into code. For authenticated test suites, parameterize the host and token, set up test data deliberately, and assert the contract in your framework. For unusual cURL options, consult the cURL manual and implement the request directly.
Make one replay safe
Redact a captured request, convert it to your target language, then compare the generated method, URL, headers, and body with the original. Exercise it against a harmless stub or test endpoint before adding assertions. Keep the redacted command alongside the test so reviewers can see what was converted.
Sources behind this example
- cURL Converter: live parsed summary and JavaScript/Python output.
- cURL manual: source command options and their request behavior.
- Python JSON documentation: JSON-to-Python value mapping.