如何使用命令提示符telnet谷歌?

时间:2012-11-24 19:38:38

标签: telnet

这就是我试过的

telnet www.google.com 80

Get   HTTP/1.1  Host:www.google.com 

这是我收到的回复

HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 925
Date: Sat, 24 Nov 2012 19:37:42 GMT
Server: GFE/2.0

如何使这项工作?我尝试使用telnet访问www.google.com

2 个答案:

答案 0 :(得分:9)

$ telnet www.google.com 80
Trying 173.194.38.82...
Connected to www.google.com.
Escape character is '^]'.
GET / HTTP/1.1

HTTP/1.1 302 Found
Location: http://www.google.co.jp/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
[.... skipped ....]

答案 1 :(得分:3)

发出请求后:

GET / HTTP/1.1

您还需要输入空行以显示您的请求已结束,否则将不会返回任何内容。

参考:http://blog.nullspace.io/day-208.html