Hi.
How can I do a cfhttp POST call, to API, in CF21, with this required parmeters:
APIKEY (string) header; DOC (file pdf) formdata; TEXT (string) formdata
Something like this:
"
<cffile action="readBinary" file="filePathName" variable="attachedFile">
<cfset attachedFile=binaryEncode(attachedFile,"BASE64")>
<cfhttp url="#externalUrlToCall_notColdfusion#" method="POST" charset="utf-8" result="apiresult" timeout="10" multipart="yes" multipartType="form-data">
<cfhttpparam type="header" name="Content-Type" value="multipart/form-data">
<cfhttpparam type="header" name="APIKEY" value="#CONSTapiKey#">
<cfhttpparam type="header" name="Content-Disposition" value="form-data; name='DOC'; filename='fileName'">
<cfhttpparam type="formfield" name="DOC" value="#attachedFile#">
<cfhttpparam type="formfield" name="TEXT" value="Hello">
</cfhttp>
"
I'm new in API call and this don't work in CF 21 (in postman or python it works).
What am I doing wrong? Can you help me?
PS I saw in python that "filename='fileName'" has full path but I don't wrote it.
I solved from python but how do same API call directly from CF 21?
I upgraded from CF 18 to CF 21 and I read that this patch is embedded; it isn't?