Posts

Showing posts from January, 2015

ColdFusion CFHTTP analogous to CURL

* This is a continuously updated post on the corresponding  CFHTTP  syntax for  CURL . If you need help, send me a message and I will try to help. I have been trying to integrate different APIs with ColdFusion/Railo recently and the difficult part is of course to understand the way the API is expecting data. Mostly they 3rd party will provide library or code for PHP and .NET, but not for ColdFusion. In some cases they provide the CURL syntax. I thought I will scribble my findings here so that it is useful for someone to write CFHTTP by seeing the CURL syntax. File Upload   e.g.:  to post a file to the folder /upload to the server. The URL is http://app.prasanthkumars.com/upload the API uses Basic Authorization File name is test.png CURL curl -f file=@test.png "http://username:password@app.prasanthkumars.com/upload" CFHTTP <cfset credentials = tobase64("#username#:#password#")> <cfhttp method="POST" url="htt