Friday, January 29, 2010

How to Test a Website Through Command Prompt

The information that is exchanged through our internet browsers travels over standard communication protocols. Most of these protocols are compatible with basic keystrokes (ASCII) characters and can be accessed in their raw format through a few keystrokes in command prompt.

1) Prepare a notepad window with the HTTP request codes that you want to run;

GET / HTTP/1.1

2) Copy the commands to the clipboard;
3) Open command prompt and telnet;

telnet 80

4) Paste the HTTP code by right-clicking; then hit enter a couple times;

Note that you will get a blank screen (unless you have full duplex connection) and will not see the keystrokes that you enter.

At this point you will see a stream of text fill the screen. You should be able to scroll back in the command prompt window; you may need to change the command prompt properties to scroll all the way back.


Debug Browser Requests

Your browser will pass many headers in each request it makes. In the past, we used to have to run HTTP monitoring tools to see what the browser was doing, but now Firefox has a great add-on called Live HTTP Headers that makes it much easier.


There are several protocols that can be used in telnet, here is a list of ones I have used:

ServiceStandard Port
HTTP (websites)80
SMTP (email sending)25
FTP (file transfer)21
POP3 (fetch messages)110
IMAP (email server)143

Other online HTTP testing tools

Pingdom is great as it shows time to first/last byte
Uptrends - several geographical sources to test from.


John said...


Very useful technique! Thanks for posting it.

- john

drodecker said...

Also see this MSFT command line tool tinyget.

RelevantAds said...

Also so this post on making a command prompt http request.

Share Links