如何在冷融合中返回请求体?

时间:2016-10-25 07:28:05

标签: coldfusion cfhttp

这里是回复的链接。

http://requestb.in/116o44e1?inspect

从这个回复中,我必须得到' RAW BODY'。为此我在Cold Fusion中尝试过这样的。

<cfhttp url="http://requestb.in/116o44e1?inspect" method="get">
<cfset getResult =(cfhttp.filecontent.RAW BODY)>
<cfoutput>#getResult#</cfoutput> 

但它不起作用。如何以正确的方式做到这一点。请帮助我。

在我尝试获取值时,这是错误:

Error

1 个答案:

答案 0 :(得分:1)

在第696行的图片中,您将其设置如下:

<cfset getresult = (cfhttp.filecontent.raw body)>

这是不正确的语法。

试试这个:

<cfhttp url="http://127.0.0.1" method="get" >

 <!--- this will return the content of your url --->
<cfset getresult=cfhttp.fileContent>

如果有帮助,请告诉我。