【问题标题】:coldfusion cfhttp GET method issue with context-type header带有上下文类型标头的coldfusion cfhttp GET方法问题
【发布时间】:2019-10-19 11:26:59
【问题描述】:
<cfhttp method="GET" url="https://xxxx/Authentication/CorpPassAuth?scope=abc&callback_url=https://xxxx/apiresponse.cfm" result="a">
<cfhttpparam type="header" name="Content-Type" value="application/json"></cfhttpparam>
<cfhttpparam type="header" name="X-IBM-Client-Secret" value="xxx"></cfhttpparam>
<cfhttpparam type="header" name="X-IBM-Client-Id" value="xxxx"></cfhttpparam>

我将相关证书导入 cacert。所有 POST 方法 API 工作正常,只有 GET 方法无法获得预期结果。预期的结果应该是 json,但结果显示了网站屏幕。 JAVA 是 1.8.0_231-b11。 SSL 证书是 entrust.net

此 API 使用 POSTMAN、API TESTER 进行测试,curl 工作正常,但coldfusion 无法获得正确结果。有谁知道哪里错了?

【问题讨论】:

    标签: coldfusion cfml cfhttp getmethod


    【解决方案1】:

    您需要使用encodeForURL 转义回调网址。

    <cfhttp method="GET" url="https://xxxx/Authentication/CorpPassAuth?scope=abc&callback_url=#encodeForURL("https://xxxx/apiresponse.cfm")#" result="a">
    

    【讨论】:

    猜你喜欢
    • 2014-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-27
    • 1970-01-01
    • 2015-04-19
    • 2014-06-19
    • 1970-01-01
    相关资源
    最近更新 更多