Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Coldfusion创建REST请求_Rest_Coldfusion - Fatal编程技术网

使用Coldfusion创建REST请求

使用Coldfusion创建REST请求,rest,coldfusion,Rest,Coldfusion,我想使用Coldfusion创建一个REST服务 我想把它发到:使用用户名“person1”和密码“password1” 数据类型应该是:application/json 我想传递以下参数: 回调URL(字符串) 金额(大十进制) 引用(字符串) 说明(字符串) 然后返回: 引用(字符串) 重定向URL(字符串) 状态(字符串) 到目前为止,我得到的是: index.cfm <cfset restInitApplication("C:\ColdFusion10\cfusion\ww

我想使用Coldfusion创建一个REST服务

我想把它发到:使用用户名“person1”和密码“password1”

数据类型应该是:application/json

我想传递以下参数:

  • 回调URL(字符串)
  • 金额(大十进制)
  • 引用(字符串)
  • 说明(字符串)
然后返回:

  • 引用(字符串)
  • 重定向URL(字符串)
  • 状态(字符串)
到目前为止,我得到的是:

index.cfm

<cfset restInitApplication("C:\ColdFusion10\cfusion\wwwroot\restApp","IIT")>

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

<cfoutput>#cfhttp.filecontent#</cfoutput>

#cfhttp.filecontent#
rest.cfc

<cfcomponent rest="true" restpath="restService">   
    <cffunction name="sayHello" access="remote" returntype="String" httpmethod="GET"> 
        <cfset callbackURL = "https://www.google.com"> 
        <cfset amount = "100,50">
        <cfset reference = "123456789">
        <cfset description = "This is a description">
        <cfreturn rest> 
    </cffunction> 
</cfcomponent>

我想知道我是否在正确的轨道上,以及如何使用用户名和密码将我的值发布到

我不确定它是否会像这样:

<cfhttp 
    url="https://www.test.co.za/"
    method="post"
    port="8500"
    result="res"> 
</cfhttp>


提前谢谢

到目前为止你都试了些什么?你能展示一些代码吗?还有。@TusharBhaware谢谢!看起来比我看到的要有用得多,我会尝试使用它,非常惊讶你没有想到谷歌“coldfusion rest”,第一个结果是文档。我用谷歌搜索了一下,但是它不是很有帮助,我仍然不明白,我还查了你的博客和Ben Nadel'sOK,你需要更专注于你的问题:尝试一些东西,陷入困境,记录你是如何陷入困境的,你尝试了什么,然后就这一件事提出一个问题。不仅仅是“我该怎么做[整个概念]”。这只是给人的印象是懒惰(你可能已经在wazoo上研究过了,但除非你详细说明,否则我们不会知道)。建议您阅读以下内容:,以及它链接到的文档。