Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send an HTTP request using Telnet [closed]

Tags:

http

web

telnet

How to get a web page's content using Telnet?

For example, the content of https://stackoverflow.com/questions.

like image 825
kirillbobyrev Avatar asked Apr 02 '13 19:04

kirillbobyrev


2 Answers

You could do

telnet stackoverflow.com 80 

And then paste

GET /questions HTTP/1.0 Host: stackoverflow.com   # add the 2 empty lines above but not this one 

Here is a transcript

$ telnet stackoverflow.com 80 Trying 151.101.65.69... Connected to stackoverflow.com. Escape character is '^]'. GET /questions HTTP/1.0 Host: stackoverflow.com  HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 ... 
like image 101
stefan bachert Avatar answered Oct 26 '22 01:10

stefan bachert


telnet ServerName 80


GET /index.html↵ ↵ 

↵ means 'return', you need to hit return twice

like image 29
ngille Avatar answered Oct 26 '22 03:10

ngille