首页 > 解决方案 > 无法在 ColdFusion 中进行 CFHTTP 调用

问题描述

我试图CFHTTP从 ColdFusion 打电话,但它不起作用。

<cfhttp url="https://apracareers.localhost/be/index.cfm?event=apm.ExecuteRuleAndActionInApmApi&testExecID=1CCDBEBA-3892-8ED2-F158-A42B9D79317F"  method="POST" resolveurl="no" charset="utf-8" >  
    <cfhttpparam type="Header" name="Accept-Encoding" value="*"> 
</cfhttp>

在我得到的日志中:

2018 年 5 月 14 日下午 14:04:13 信息 [A9ACF8BE-FFAD-0210-F70213D0E7DEF338] - 开始 HTTP 请求 {URL=' https://apracareers.localhost/be/index.cfm?event=apm.ExecuteRuleAndActionInApmApi&testExecID=1CCDBEBA- 3892-8ED2-F158-A42B9D79317F ',方法='POST'}

标签: web-servicescoldfusion

解决方案


如果您在设置了代理服务器的环境中运行它,您可能需要在 cfhttp 标记中添加代理服务器和代理端口。

<cfhttp url="yourURL" method="post" proxyserver="xproxy.what.ever"  result="httpResult" proxyport="8080" >
 <cfhttpparam type="Header" name="Accept-Encoding" value="*"> 
</cfhttp>

推荐阅读