【问题标题】:Trying to get Magento 1.9 orders via Rest with CFHTTP尝试使用 CFHTTP 通过 Rest 获取 Magento 1.9 订单
【发布时间】:2018-01-20 19:05:14
【问题描述】:

我正在尝试使用 Coldfusion 从我们的 Magento 网站获取订单列表。 CF 11。

我已经设法验证并获取令牌,但每次我向端点发出 cfhttp get 请求时,我得到的只是 HTML

我在会话中有变量,但我只是想转储一个订单列表

<cfhttp url="http://magento-test-box.local/rest/admin/V1/orders" method="post">
<cfhttpparam type="header" name="accept" value="application/json">
<cfhttpparam type="header" name="content-type" value="application/json">
<cfhttpparam type="header" name="authorization : bearer" value="#variables.oauth_token#">
</cfhttp>
<cfdump var="#cfhttp#">

还有什么我应该添加到 http 请求的吗?

提前致谢

【问题讨论】:

    标签: magento coldfusion


    【解决方案1】:

    我注意到的第一件事是:

    <cfhttpparam type="header" name="authorization : bearer" value="#variables.oauth_token#">
    

    试试这个:

    <cfhttpparam type="header" name="Authorization" value="Bearer #variables.oauth_token#">
    

    (根据规范,AuthorizationBearer 应该是不区分大小写的,但您应该测试这两种情况,以防 Magento 比较大小写。)

    【讨论】:

      猜你喜欢
      • 2014-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多