6

I would like to view the actual http request that gets sent via my cfhttp tag. What is the best tool to capture this?

Specially, I want to see exactly what headers and content are being sent.

Jason
  • 17,276
  • 23
  • 73
  • 114
  • possible duplicate of [How to debug RESTful services?](http://stackoverflow.com/questions/165720/how-to-debug-restful-services) – Henry Aug 18 '10 at 18:45
  • Unfortunately, I'm not running it locally. The page is being run from a web server that I don't have access to setup one of these tools. I didn't know if there was a way in ColdFusion to view a request before (or after) it was sent. – Jason Aug 18 '10 at 18:47
  • 3
    One roundabout way would be to point the http request (or duplicate it into a testing template) back to a debug template on the same CF Server that dumped everything to a file. – Edward M Smith Aug 18 '10 at 18:59
  • @Jason, are you sure? those tools are mostly client side. You don't have access to client side? then how do you debug basic CFML codes? – Henry Aug 18 '10 at 19:02
  • 2
    @Henry I can run those tools locally but they can't see the requests that are being made from my web server to another web server. They only see the request I make to my ColdFusion web server. That request does not contain the information I need. – Jason Aug 18 '10 at 19:07
  • @Edward How could I view that request with a ColdFusion page? – Jason Aug 18 '10 at 19:19
  • Just make a CF page that dumps the url scope, the form scope, and I guess, the CGI scope. You can then see what was in the url, what was posted (if its a post), and various other items. If the request is more complicated (like an xmlrpc or soap invocation) or you're into a more low level display , do what Stephen suggests as a solution, and dump getHttpRequestData(). – Edward M Smith Aug 18 '10 at 22:25

3 Answers3

4

To expand on what Edward has said and to answer your question about how you can view a request on ColdFusion;

Create a page that simply dumps everything out from GetHttpRequestData().

Have a look at the livedocs on getHttpRequestData() for more information.

Stephen Moretti
  • 2,442
  • 1
  • 18
  • 29
0

Use Charles http proxy. Add the proyport and proxyhost attribute that points to your running instance of Charles. Caveat is that your machine will need to be reachable, and the port open for the server to reach.

David Collie
  • 612
  • 3
  • 7
0

I'd use sniffer if other side is also CF/Java based server http://kb2.adobe.com/cps/193/tn_19352.html

zarko.susnjar
  • 2,053
  • 2
  • 17
  • 35