CFHTTP Raw Request

145 views
Skip to first unread message

hofar...@houseoffusion.com

unread,
Oct 8, 2014, 12:17:37 PM10/8/14
to ColdFusion Technical Talk

I have a process that is sending xml via cfhttp and I am not getting the anticipated response from the web service. I would like to see the actual headers and the body of the request.

Does anyone know if there is a way to track the raw request that is created by a cfhttp post?

Thanks,

Donnie Carvajal

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359412

hofar...@houseoffusion.com

unread,
Oct 8, 2014, 1:33:35 PM10/8/14
to ColdFusion Technical Talk

If you are doing this on a developer machine, install fiddler. Then you can watch everything the request and response and look at the raw outputs. It has saved me multiple times from pulling my hair out.

Steve
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359413

hofar...@houseoffusion.com

unread,
Oct 8, 2014, 2:05:15 PM10/8/14
to ColdFusion Technical Talk

Try the getpagecontext or getmetadata functions.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359415

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 11:21:57 AM10/14/14
to ColdFusion Technical Talk

Hi Steve,

Thanks for the suggestion. I've never used Fiddler before. Are there any special configurations to watch a cfhttp request?

Thanks,

Donnie Carvajal
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359462

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 12:05:07 PM10/14/14
to ColdFusion Technical Talk

It's just a program that when run will sit between the browser and the world outside the computer (internet, intranet, etc). It displays what is going in and out.

It's an easy install and adds piece to IE/Chrome/Firefox as well as installing the App. You just run it and use your web browser. If you are working with HTTPS/SSL/TLS then there is a way to set it up to track that data as well (Technically a man in the middle, but you are doing it to yourself so it's ok).

Steve
-----Original Message-----
From: Donnie Carvajal [mailto:donnie....@transformyx.com]
Sent: Tuesday, October 14, 2014 11:21 AM
To: cf-talk
Subject: Re: CFHTTP Raw Request


Hi Steve,

Thanks for the suggestion. I've never used Fiddler before. Are there any special configurations to watch a cfhttp request?

Thanks,

Donnie Carvajal


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359463

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 12:53:28 PM10/14/14
to ColdFusion Technical Talk

I think I may be confused. I need to see the raw headers that CFHTTP is creating. I installed Fiddler on the development and ran it. When I call the CF page that includes the CFHTTP, I am not seeing any new requests in Fiddler. I'm not sure how a browser would show me CFHTTP headers that are created. Am I missing something?

Thanks,

Donnie Carvajal
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359465

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 1:00:17 PM10/14/14
to ColdFusion Technical Talk

Donnie,

you will need a sniffer on the server to see any HTTP request from CF. If
you are doing local development (where cf is installed on your laptop or
desktop) then that's where your proxy/sniffer needs to live. CFHTTP is
technically not a "browser" request - just a straight HTTP request using
tcp. I use wireshark for this - fiddler is more of a browser plugin - or at
least, it proxys it's data to a browser. I suspect it "could" work for
cfhttp request -just not positive as I've never tried it. Steve's suggestion
is a good one and fiddler (or Charles) is a great addition to your toolkit
but it may not work in this specific instance. Sorry to redirect your
efforts :)

-Mark


Mark Kruger - CFG
CF Webtools
www.cfwebtools.com
www.coldfusionmuse.com
O: 402.932.3318
E: mkr...@cfwebtools.com
Skype: markakruger
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359466

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 1:11:33 PM10/14/14
to ColdFusion Technical Talk

> you will need a sniffer on the server to see any HTTP request from CF. If
> you are doing local development (where cf is installed on your laptop or
> desktop) then that's where your proxy/sniffer needs to live. CFHTTP is
> technically not a "browser" request - just a straight HTTP request using
> tcp. I use wireshark for this - fiddler is more of a browser plugin - or at
> least, it proxys it's data to a browser. I suspect it "could" work for
> cfhttp request -just not positive as I've never tried it. Steve's suggestion
> is a good one and fiddler (or Charles) is a great addition to your toolkit
> but it may not work in this specific instance. Sorry to redirect your
> efforts :)

Fiddler is more than a browser plugin. It's a proxy server, and can in
fact capture all outbound HTTP requests from your machine, regardless
of what they come from. I prefer Fiddler to Wireshark for this because
it's purely focused on HTTP/HTTPS and a lot easier to read.

However, you have to configure clients to use it as a proxy. With CF,
you can do this at the JVM level, or you can change your CFHTTP code
to use a specific proxy server.

Dave Watts, CTO, Fig Leaf Software
1-202-527-9569
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Service-Disabled Veteran-Owned Small Business
(SDVOSB) on GSA Schedule, and provides the highest caliber vendor-
authorized instruction at our training centers, online, or onsite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359467

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 1:14:02 PM10/14/14
to ColdFusion Technical Talk

Ah... so you would have to use the proxy/port attributes of the cfhttp tag.
I see how that would work. On the plugin install it sets that up for you
with the browser. Good to know.

-----Original Message-----
From: Dave Watts [mailto:dwa...@figleaf.com]
Sent: Tuesday, October 14, 2014 12:11 PM
To: cf-talk
Subject: Re: CFHTTP Raw Request


Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359468

hofar...@houseoffusion.com

unread,
Oct 14, 2014, 2:05:25 PM10/14/14
to ColdFusion Technical Talk

CF has to be running on your local machine to see it. If you are doing it on a development server then you have to install fiddler on the dev server and run the browser from there.

Steve

-----Original Message-----
From: Donnie Carvajal [mailto:donnie....@transformyx.com]
Sent: Tuesday, October 14, 2014 12:53 PM
To: cf-talk
Subject: Re: CFHTTP Raw Request


I think I may be confused. I need to see the raw headers that CFHTTP is creating. I installed Fiddler on the development and ran it. When I call the CF page that includes the CFHTTP, I am not seeing any new requests in Fiddler. I'm not sure how a browser would show me CFHTTP headers that are created. Am I missing something?

Thanks,

Donnie Carvajal

Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359469
Reply all
Reply to author
Forward
0 new messages