我正在学习 http,并尝试使用 telnet 发送我自己的 http 请求。
在命令提示符下,我输入:
telnet google.com 80
结果: 屏幕清空,我看到一个闪烁的光标。 1. 为什么我没有看到任何已连接的迹象?
现在,尝试输入一个 http 命令(获取 index.html...) 我看到光标在我键入时向右移动,但我没有看到屏幕上出现字母。只有空白。 2. 为什么会这样?
(使用windows7 64位)
最佳答案
Why don't I see any indication that I'm connected?
空白屏幕上闪烁的光标是您已连接的指示。否则,您将收到描述无法连接原因的错误消息。
I see the cursor moving to the right as I type, but I don't see the letters appear on the screen.
an http command (get index.html...)
这不是有效的 HTTP 请求,您至少应该输入类似这样的内容,然后输入两个 Enter:
GET / HTTP/1.1
Host: google.com
查看RFC了解如何构建 HTTP 请求并查看一些示例。
关于http - windows下使用telnet测试HTTP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13180487/