您现在的位置是:首页 > web开发 > HTTP解读

HTTP解读

web开发作者:dayu日期:4天前点击:0

使用Telnet工具访问web资源

Windows中没有telnet这一工具,下面在Linux下演示:

telnet www.baidu.com 80

Trying 61.135.169.125...
Connected to www.baidu.com.
Escape character is ‘^]‘.
GET / HTTP/1.1 //请求首行

HTTP/1.1 302 Moved Temporarily //响应首行
Date: Sat, 22 Jul 2017 06:47:00 GMT //响应首部
Content-Type: text/html
Content-Length: 215
Connection: Keep-Alive
Location: http://www.baidu.com/search/error.html
Server: BWS/1.1
X-UA-Compatible: IE=Edge,chrome=1
BDPAGETYPE: 3
Set-Cookie: BDSVRTM=0; path=/

<html> //响应主体(首部和主体之间用空行隔开)
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>pr-nginx_1-0-345_BRANCH Branch
Time : Wed Jun 28 10:14:05 CST 2017</center>
</body>
</html>

说明:输入完请求首行之后要按2次回车

HTTP解读

原文地址:http://www.cnblogs.com/leomei91/p/7221381.html


下一篇       上一篇