tags:

views:

32

answers:

1

Hello,

I have to ensure that curl is sending cookies propertly, so I should view full text of request (not response!) http headers. Is there any way to do it?

Thank you

A: 

Obviously, you need to intercept the request headers at some point. Considering you want to see headers from curl, I would suggest setting up a transparent proxy. For a relatively simpler solution, I would suggest a tool such as WireShark.

Dolph
It's easier to create php page with [code]foreach (getallheaders() as $name => $value) echo "$name: $value\n";[/code]. UPD: Thank you for sharing WireShark, it's really nice idea to sniff all http traffic to figure out what headers curl is using for request.
Kirzilla
I didn't see the `php` tag... I assumed you were running curl from the command line. Marking your question as a dupe (see answer for php): http://stackoverflow.com/questions/866946/how-can-i-see-the-request-headers-made-by-curl-when-sending-a-request-to-the-serv/2138886#2138886
Dolph