如何使用Telnet
Abstract
> 退出telnet使用ctrl + ] 再 ctrl + d
# 发送HTTP请求
## 打开连接
```
telnet chengyao.xyz 80
```
## 发送数据
```
GET
退出telnet使用ctrl + ] 再 ctrl + d
发送HTTP请求
打开连接
telnet codeemo.cn 80
发送数据
GET / HTTP/1.1
Host: localhost
\r\n
这里的Host是必须的,否则会400
发送Content-Length 头后服务端会等待输入相应长度的内容后才返回
POST 提交的时候需要添加Content-Type
结果
cheng@DESKTOP-845LJ9G:/mnt/c
Login required to read the rest of the content
登录 to comment~
Guess you like
Recommended articles