Title:
cfhttp / cfhttpparam formfield elements are ignored if the cfhttp method is not GET or POST
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Chris Herdt / Chris Herdt (Chris Herdt)
Created: 04/05/2013
Components: Net Protocols
Versions: 9.0.1
Failure Type: Non Functioning
Found In Build/Fixed In Build: 9.0.1 / CF10_Update14
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 1
Problem Description:
Although the documentation for cfhttpparam states that "The formField type attribute is only meaningful with the cfhttp tag POST and GET methods." However, RESTful APIs may require form fields with other methods, such as DELETE and PUT. Other HTTP tools, such as cURL and Java's HttpURLConnection class, do send form fields with other request methods when specified.
The specific example I am looking at is Instructure's Canvas API, e.g. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.update
Steps to Reproduce:
<cfhttp url="#uri#" result="result" method="PUT">
<cfhttpparam type="header" name="Authorization" value="Bearer #accessToken#" />
<cfhttpparam type="formfield" name="name" value="SAMPLE" />
</cfhttp>
(Where uri is an API endpoint and accessToken is a valid access token.)
Actual Result:
The API request succeeds, but the data is not changed.
Expected Result:
A successful API request that changes the data.
Any Workarounds:
I have used the underlying Java classes to get around this issue, but I feel like this should work using the CF tags.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3537036
External Customer Info:
External Company:
External Customer Name: cherdt
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: