先在命令行输入以下命令:
telnet www.baidu.com 80
点击确认之后出现如下界面
然后接着输入以下两行命令
GET /index.html HTTP/1.1
Host: www.baidu.com
到了这里 接着连续按两下 enter键 就会返回百度首页的内容 如下:
HTTP/1.1 200 OK Date: Sun, 17 Sep 2017 09:31:07 GMT Content-Type: text/html Content-Length: 14613 Last-Modified: Thu, 14 Sep 2017 03:04:00 GMT Connection: Keep-Alive Vary: Accept-Encoding Set-Cookie: BAIDUID=B0BE15AB9B826700DABA32CFEA847004:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com Set-Cookie: BIDUPSID=B0BE15AB9B826700DABA32CFEA847004; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com Set-Cookie: PSTM=1505640667; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com P3P: CP=" OTI DSP COR IVA OUR IND COM " Server: BWS/1.1 X-UA-Compatible: IE=Edge,chrome=1 Pragma: no-cache Cache-control: no-cache Accept-Ranges: bytes <!DOCTYPE html><!--STATUS OK--> <html>
....
</html>