Got a good one for Red Hat Enterprise Linux 5.3?
Main Topics
Browse All TopicsI need to see the raw "post request" with headers, and the raw "response" with headers.
It's a function in my C++ program. How can I enable this feature?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
netcat can be configured to act as a logging proxy.
I am looking up the options. They seem to have changed since I last used it, I cannot use -l and -p together on my box.
Its installed as part of RH 5.3, binary is 'nc'
http://netcat.sourceforge.
I am trying to get a working sample for you...
I've used LibCurl to do exactly this, but it's been a while. I'm pretty sure the combination of options below should give you what you need.
CURLOPT_HEADER
A parameter set to 1 tells the library to include the header in the body output. This is only relevant for protocols that actually have headers preceding the data (like HTTP).
CURLOPT_HEADERFUNCTION
Function pointer that should match the following prototype: size_t function( void *ptr, size_t size, size_t nmemb, void *stream);. This function gets called by libcurl as soon as it has received header data. The header callback will be called once for each header and only complete header lines are passed on to the callback. Parsing headers should be easy enough using this. The size of the data pointed to by ptr is size multiplied with nmemb. Do not assume that the header line is zero terminated! The pointer named stream is the one you set with the CURLOPT_WRITEHEADER option. The callback function must return the number of bytes actually taken care of, or return -1 to signal error to the library (it will cause it to abort the transfer with a CURLE_WRITE_ERROR return code).
If this option is not set, or if it is set to NULL, but CURLOPT_HEADERDATA (CURLOPT_WRITEHEADER) is set to anything but NULL, the function used to accept response data will be used instead. That is, it will be the function specified with CURLOPT_WRITEFUNCTION, or if it is not specified or NULL - the default, stream-writing function.
Since 7.14.1: When a server sends a chunked encoded transfer, it may contain a trailer. That trailer is identical to a HTTP header and if such a trailer is received it is passed to the application using this callback as well. There are several ways to detect it being a trailer and not an ordinary header: 1) it comes after the response-body. 2) it comes after the final header line (CR LF) 3) a Trailer: header among the response-headers mention what header to expect in the trailer.
CURLOPT_WRITEHEADER
(This option is also known as CURLOPT_HEADERDATA) Pass a pointer to be used to write the header part of the received data to. If you don't use your own callback to take care of the writing, this must be a valid FILE *. See also the CURLOPT_HEADERFUNCTION option above on how to set a custom get-all-headers callback.
Business Accounts
Answer for Membership
by: mrjoltcolaPosted on 2009-06-03 at 18:06:51ID: 24542801
Hi M256, I don't know the CURL library, but I can recommend a good program that you can use to snoop an HTTP on a system, regardless of where it is generated, as it is an in-between proxy.
iddler2.co m/fi ddler2 /
Fiddler2
http://www.f