Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 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


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.