Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using ngrep for checking out http headers, I've never managed to get something transparent out of tcpdump and I don't like GUI apps like wireshark. ngrep is great, but I can't seem to find a way to grep headers of POST requests and content of their bodies ... Could please anybody tell me how to do that, or suggests some other methods of printing headers and content of POST request bodies ?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

What is the ngrep command that you're using? The following will show you the body of POST requests (assuming the standard port 80).

ngrep "POST" tcp and port 80

Keep in mind that frequently POST data is encoded in some binary format (often gzip for compression) so you won't be able to read it just by watching the ngrep output.

share|improve this answer

You might want to look at curl. There is a -D option that will dump the HTTP headers out to a file for inspection. There are also a ton of other options that might be useful, depending on what you're actually trying to accomplish.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.