Viewing HTTP headers
|by Anton Tagunov|
It is often desirable to see what HTTP headers the web server is sending to the client. For example, you may want to make sure that the correct Content-Type header is issued. I will recommend the following tools for doing this:
wget. wget is a standard tool on many unix systems. You can get a port for Windows at ftp://ftp.sunsite.dk/projects/wget/windows. -s parameter instructs wget to show the HTTP headers. Here is an example:
This example instructs wget to
|-O-||output the downloaded page to it's standard output stream|
|"http://..."||download from the given url. you may specify query string|
|| more||may be usefull if the page to be downloaded is large and does not fit into one screen. After all we may want to see only the headers and then press q to stop it|
Of course wget can be instructed to save the downloaded data to file:
TcpTunnelGui utility. wget is great but it does not maintain sessions with the webserver (since it is not a browser and does not support cookies). Neither it can help you to test POST submitted HTML forms. A solution is to run a proxy utility on your computer that will show you what your browser and web server are sending each other.
TcpTunnelGui is an example of such utility. It is written in java and is part of the Apache SOAP project. You can download the distribution here. After you've downloaded the distribution, get soap.jar out of it, and do something like
This sample invocation instructs the utility to listen on port 8000, redirect all requests to localhost:8080 (where local Tomcat usually runs) and display all the interexchange in its window.
TcpTrace utility. An analog of the TcpTunnelGui utility written in c++ for Windows. You may download it in native code from http://www.pocketsoap.com/tcptrace/. To me it looks like it has a little bug - the clear window menu item does not work reliably.