I am successfully able to execute the following curl request using Git Bash.
curl -X PUT \
https://www.cospheric.com/api/v1/products/356 \
-H 'Content-Type: application/json' \
-H 'X-AC-Auth-Token: {mytoken}' \
-d '{"quantity_on_order": 40}'
I am using the following code so that it can run in CF.
<cfhttp method="PUT" url="https://www.cospheric.com/api/v1/products/356">
<cfhttpparam type="header" name="X-AC-Auth-Token" value="{my token}" />
<cfhttpparam type="header" name="Content-Type" value="application/json">
<cfhttpparam type="header" name="Accept" value="*/*">
<cfhttpparam name="quantity_on_order" encoded="no" type="FORMFIELD" value="40" />
</cfhttp>
However, when I run this code, I get he following error:
{"status_code":500,"message":"Internal Server Error","details":"Object reference not set to an instance of an object."}
Can anyone please help me understand why it works fine when I run the curl statement, but failing in CF? Any help would be much appreciated.