cURL to ColdFusion Converter
Convert curl commands to ColdFusion code using cfhttp. Paste a command and the ColdFusion snippet appears instantly — everything runs in your browser.
- Instant ConversionCode updates as you type
- Multiple Languages40 languages, 61 libraries
- 100% Client SideYour data stays private
How to use this tool
Steps for using the cURL to Code.
- Copy a curl command — from API documentation, or from your browser's DevTools (Network tab → right-click a request → Copy as cURL (bash)).
- Paste it into Enter cURL command. The ColdFusion cfhttp code appears instantly.
- Set up: cfhttp is built into CFML engines such as Adobe ColdFusion and Lucee.
- Run it: Save the code as a
.cfmpage and open it through your CFML server. Replace placeholders such asYOUR_TOKENfirst, and check any notes under the editors for curl options that have no cfhttp equivalent.
Example
GET with headers → ColdFusion cfhttp
curl 'https://api.example.com/v1/users?page=2' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'<cfscript>
cfhttp(method="GET", url="https://api.example.com/v1/users?page=2", result="response") {
cfhttpparam(type="header", name="Accept", value="application/json");
cfhttpparam(type="header", name="Authorization", value="Bearer YOUR_TOKEN");
}
writeOutput(response.statusCode & chr(10));
writeOutput(response.fileContent);
</cfscript>Common use cases
- CFML applications calling REST APIs
- Scheduled tasks that sync data
- Webhooks
Converting curl to ColdFusion cfhttp
cfhttp sends HTTP requests from CFML, with cfhttpparam for headers, form fields and the body.
The converter reads the curl command the way curl does — the method (-X), headers (-H), request bodies (-d, --data-raw, --json, -F), query strings, basic auth (-u) and cookies — and writes the equivalent cfhttp code. Options that have no cfhttp equivalent are listed under the editors rather than silently dropped.
Limitations
- The code is a starting point: add timeouts, retries and error handling for production use.
- Secrets in the curl command are copied into the code — move them to environment variables before committing.
Frequently asked questions
Where is the response in ColdFusion?
In the response struct: response.statusCode and response.fileContent.
How are JSON bodies sent?
As a cfhttpparam of type body with the JSON text, together with a Content-Type header.
Is my curl command sent to a server?
No. The conversion runs entirely in your browser, so tokens and passwords in the command never leave your device. Still, replace real secrets before sharing the generated code.