问题
I was integrating a REST API of iCIMS and found some of the REST API calls need the http verb PATCH. However, it seems ColdFusion 10 doesn't support that. Is there any way around this?
回答1:
This was not added until ColdFusion 11 update 3.
Most API services allow you to use POST instead of PATCH. From the docs for iCIMS it appears they accept either POST or PATCH as well.
回答2:
Working with iCIMS API also here, but on CF 9, so no support for PATCH. But I did find that you can do a POST and then override that with an additional header: X-HTTP-Method-Override: PATCH
On iCIMS API, the PATCH method is required to update some data vs. a POST which creates a new entry. So something like the following should work.
<cfhttp method="post" url="api.icims.com/customers/1234/people/1289/fields/phones/332">
<cfhttpparam type="header" name="Authorization" value="Basic #auth_string#" >
<cfhttpparam type="header" name="X-HTTP-Method-Override" value="PATCH">
<cfhttpparam type="body" value="#your_json#" >
</cfhttp>
来源:https://stackoverflow.com/questions/28689612/how-to-make-http-call-with-action-patch-using-cfhttp-coldfusion-10