How to use the HTTP commands GET and HEAD
Here's a short tutorial on how to use GET and HEAD commands. Note: What you have to type is in blue colour. To check the header sent by the server for, say slashdot.org, this is what you do:
- Start a DOS prompt if you're using Windows, Terminal if you're using a Mac or a *nix terminal/Linux terminal if you're using Unix/Linux.
- Telnet to the server at port 80. What you have to type is in blue colour. The output is in white. Check the screenshot below:
$ telnet slashdot.org 80 Trying 188.8.131.52... Connected to slashdot.org (184.108.40.206). Escape character is '^]'. HEAD / HTTP/1.1 Host: slashdot.org Connection: close HTTP/1.1 200 OK Date: Wed, 10 Dec 2008 20:58:58 GMT Server: Apache/1.3.41 (Unix) mod_perl/1.31-rc4 SLASH_LOG_DATA: shtml X-Powered-By: Slash 2.005001234 X-Fry: I can burp the alphabet. A, B, D ... no, wait ... Cache-Control: private Pragma: private Connection: close Content-Type: text/html; charset=iso-8859-1 Connection closed by foreign host.
Last Update: 01 December 2008 [Created on 02 December 2008]
If you liked this article, follow us on Facebook and Twitter (@aruljohn).