CFHTTP PUT without a physical file
- by E-Madd
I'm trying to communicate with an API that requires JSON payloads via PUT method. Is it possible to do this in CFHTTP with CFHTTPPARAM without first writing a file? My code currently looks like this...
<cfset json = "{'key':'value'}">
<cffile action="write" file="#ExpandPath('./test.js')#" output="#json#" />
<cfhttp method="put" url="http://servicedomain.com/api/method/" resolveurl="no" username="username" password="password">
<cfhttpparam mimetype="application/json" type="file" name="payload" file="#ExpandPath('./test.js')#" />
</cfhttp>