4

Is there a way to output the raw html of a CFHTTP call? I am trying to see how some of the header authentication information is coming across.

I am open to browser plugins or code updates whichever helps me see what is going on during the cfhttp call.

So for example:

<cfhttp method="get" url="https://test-ows01.mywebsite.com/criminal_api//1.0/service/requests" result="orderList">
    <cfhttpparam type="HEADER" name="Authorization" value="Basic #ToBase64("bearer:4EC8B09D3F911764B1DCD3EFA38DFB31")#">
</cfhttp>

what does the above call look like when it happens.

Denoteone
  • 4,043
  • 21
  • 96
  • 150
  • Cfhhtp is processed by coldfusion on the server. So you can not see what is happening during the call in the browser. I am not sure some external system like fusion reactor also track and provide any info related to that. If you want to see what result it returns then just dump the result variable. For more info look at the documentation http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ffc.html – Keshav jha May 03 '16 at 18:58
  • Sorry for above typo its cfhttp. If you want to see response header then just check it in orderlist.responseHeader. here orderList is your result variable – Keshav jha May 03 '16 at 19:08

2 Answers2

9

If I am understanding correctly, it sounds more like you want to view the http request sent to the remote server, rather than what is received. Installing a tool like Fiddler will provide very robust debugging, allowing you to view http requests as they happen. (See also the documentation for Enable HTTPS traffic decryption).

Tip for quick debugging, a low-tech hack is to switch the target URL to a separate .cfm script on your server. Inside the script, dump GetHTTPRequestData(), to display the request headers and body sent to the script.

test.cfm

<cfhttp method="get" url="http://localhost/receivingPage.cfm" result="orderList">
    <cfhttpparam type="HEADER" name="Authorization" 
         value="Basic #ToBase64("bearer:4EC8B09D3F911764B1DCD3EFA38DFB31")#">
</cfhttp>

receivingPage.cfm

<cfdump var="#GetHTTPRequestData()#">
Community
  • 1
  • 1
Leigh
  • 28,765
  • 10
  • 55
  • 103
1

You can use requestcatcher.com for this. It let you make a personal subdomain and then you can send your request to that URL. Very handy. Helped me alot for a complex SOAP integration.

GunterO
  • 389
  • 2
  • 13