1.cmd 下 telnet 主机地址(本地127.0.0.1) 80
若打不开 在控制面板》程序和功能》打开或关闭Windows》开启telnet
2.按下Ctrl + “]” 在按下回车键
3.发送请求报文
再按一次回车
GET(请求方法) /test/test1.php(请求URL) HTTP/1.1(请求协议版本)
Host:localhost(请求首行)
(空行)
响应内容
HTTP/1.1 200(响应结果状态码) OK(状态描述)
Date: Thu, 23 Nov 2017 12:26:04 GMT
Server: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.15
X-Powered-By: PHP/5.6.15
Content-Length: 11
Connection: close
Content-Type: text/html; charset=UTF-8
hello world
POST 方法
POST /test/test1.php HTTP/1.1
HOST:localhost
Content-type:application/x-www-form-urlencoded
content-length:20
act=query&name=ghostHTTP/1.1 200 OK
Date: Thu, 23 Nov 2017 12:40:43 GMT
Server: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP
X-Powered-By: PHP/5.6.15
Content-Length: 11
Content-Type: text/html; charset=UTF-8
query
ghost