Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using telnet under windows to test HTTP

I'm learning http, and trying to use telnet to send my own http requests.

In the command prompt, I entered:

telnet google.com 80

Result: The screen is cleared and I see a blinking cursor. 1. Why don't I see any indication that I'm connected?

Now, trying to type an http command (get index.html...) I see the cursor moving to the right as I type, but I don't see the letters appear on the screen. Only blanks. 2. Why is that?

(Using windows7 64 bit)

like image 211
shealtiel Avatar asked Nov 01 '12 15:11

shealtiel


1 Answers

Why don't I see any indication that I'm connected?

The blinking cursor on a blank screen is the indication you are connected. Otherwise, you'll get an error describing why you couldn't connect.

I see the cursor moving to the right as I type, but I don't see the letters appear on the screen.

Use localecho.

an http command (get index.html...)

That is not a valid HTTP request, you should at least type something like this, followed by two Enters:

GET / HTTP/1.1
Host: google.com

Look at the RFC on how to construct an HTTP request and see some samples.

like image 193
CodeCaster Avatar answered Dec 19 '22 11:12

CodeCaster