How to use the HTTP commands GET and HEAD

Published December 01, 2008

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 216.34.181.45...
Connected to slashdot.org (216.34.181.45).
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.
Table of Contents

If you have any questions, please contact me at arulbOsutkNiqlzziyties@gNqmaizl.bkcom. You can also post questions in our Facebook group. Thank you.

One Command to Start FTP and Http S...
One Command to Start FTP and Http Services in Linux Server

Disclaimer: Our website is supported by our users. We sometimes earn affiliate links when you click through the affiliate links on our website.

Last Updated: December 01, 2008.     This post was originally written on December 02, 2008.