1
<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>

I imported related-certificate into cacert. All POST method API is working fine only the GET method cannot get the expected result. The expected result should is json but the result showing me the website screen. The JAVA is 1.8.0_231-b11. The SSL cert is entrust.net

This API is tested by using POSTMAN, API TESTER, curl is working fine but coldfusion cannot get the correct result. Anyone know which part is wrong?

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
engchun
  • 11
  • 1

1 Answers1

1

You need to escape the callback url with encodeForURL.

<cfhttp method="GET" url="https://xxxx/Authentication/CorpPassAuth?scope=abc&callback_url=#encodeForURL("https://xxxx/apiresponse.cfm")#" result="a">
Dan Roberts
  • 4,664
  • 3
  • 34
  • 43
  • 1
    [encodeForUrl vs. urlEncodedFormat](https://stackoverflow.com/questions/25516195/how-to-make-encodeforurl-encode-the-same-way-as-urlencodedformat) – Alex Oct 19 '19 at 13:03
  • Still couldn't get the expected result even remove the URL parameter. – engchun Oct 20 '19 at 01:26