我有一个使用cfhttp调用远程服务的cfc。服务返回一个失败代码,这意味着我对远程服务的调用格式不正确。有没有办法捕获我正在发送的cfhttp帖子的内容?我想要捕获原始的post数据,这样我就可以看到我的格式化问题在哪里。下面是我的代码的示例:
<cfhttp url="https://www.webservice.com" method="POST" result="httpResponse">
<cfhttpparam type="formField" name="method" value="doSomething">
<cfhttpparam type="formField" name="user" value="myUserName">
<cfhttpparam type="formField" name="password" value="myPassword">
</cfhttp>我想做这样的事情:
<cfset result = structNew() />
<cfset result["response"] = httpResponse />
<cfset result["sentContent"] = cfhttp.sentContent />有没有可能在不查看服务器日志的情况下获得已发送的cfhttp的内容。我的服务器不在现场,获取日志将是一件非常困难的事情。
发布于 2012-07-31 19:54:37
您可以创建一个要发布到的模板。该模板可以返回GetHttpRequestData()函数的结果。
https://stackoverflow.com/questions/11739140
复制相似问题