在使用 API 时,我需要向PUT
URL 发出请求,并且需要将一些参数作为 POST 参数传递。
在本地,我创建了 2 个文件 call.cfm 和 caller.cfm 来测试带有PUT
请求的 cfhttp。但每次它都抛出错误The request has exceeded the allowable time limit Tag: cfhttp
调用者.cfm
<cfhttp url="http://cflocal.com/jquerySliderApp/calling.cfm" method="put">
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form- urlencoded; charset=UTF-8" />
<cfhttpparam type="body" value="Deepak" >
</cfhttp>
<cfdump var="#cfhttp#">
呼叫.cfm
<cfloop collection="#FORM#" item="i">
<cfoutput>FORM SCOPE:#form[i]#</cfoutput>
</cfloop>
<cfloop collection="#URL#" item="i">
<cfoutput>URL SCOPE:#URL[i]#</cfoutput>
</cfloop>
我type="body"
在 Adobe 论坛中传递参数,有人提到 ColdFusion 发送带有 PUT 和 DELETE 请求的请求正文,因此我们可以将请求正文格式化为表单字段(或一系列表单字段)。
我试过了<cfhttpparam type="body" name="fname" value="#urlEncodedFormat("Deepak")#" >
。仍然显示相同的错误。
我正在使用 ColdFusion 10。如果我做错了什么,请告诉我。