Chinaunix首页 | 论坛 | 博客
  • 博客访问: 475376
  • 博文数量: 111
  • 博客积分: 3146
  • 博客等级: 中校
  • 技术积分: 939
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-07 11:23
个人简介

Nathing

文章分类

全部博文(111)

文章存档

2016年(2)

2015年(1)

2014年(31)

2012年(2)

2011年(9)

2010年(36)

2009年(30)

我的朋友

分类: Java

2011-07-13 23:59:59

请求行:
格式: 请求方式   资源路径 HTTP版本号
例如: GET /test.html HTTP/1.1
请求方式有: POST,HEAD,OPTIONS,DELETE,PUT
 
状态行:
格式:  HTTP版本号 状态吗 原因描述
例如:   HTTP/1.1 200 OK
 
实例:用telnet请求apache服务器:
>telnet localhost 80 回车
>ctrl+] 回车
>GEG /index.php HTTP/1.0 两个回车
 
HTTP/1.1 200 OK
Date: Wed, 13 Jul 2011 14:25:37 GMT
Server: Apache/2.2.8 (Win32) PHP/6.0.0-dev
Last-Modified: Wed, 13 Jul 2011 14:02:56 GMT
ETag: "f0000000101ef-8-4a7f3df920d68"
Accept-Ranges: bytes
Content-Length: 8
Connection: close
Content-Type: text/html
新建网页
失去了跟主机的连接。
 
>GEG /index.php HTTP/1.1 两个回车
 
HTTP/1.1 400 Bad Request
Date: Wed, 13 Jul 2011 14:27:07 GMT
Server: Apache/2.2.8 (Win32) PHP/6.0.0-dev
Content-Length: 319
Connection: close
Content-Type: text/html; charset=iso-8859-1

                                                 
                                                              400 Bad Req<BR>uest
           
                        

Bad Request


                                            

Your browser sent a request that
 this server could not understand.

                                       


                                           

                                               
Apache/2.2.8 (Win32) PH
P/6.0.0-dev Server at Port 80

                                                      

失去了跟主机的连接。

>GEG /index.php HTTP/1.1 回车
>Host: 两个回车
 
HTTP/1.1 200 OK
Date: Wed, 13 Jul 2011 14:29:16 GMT
Server: Apache/2.2.8 (Win32) PHP/6.0.0-dev
Last-Modified: Wed, 13 Jul 2011 14:02:56 GMT
ETag: "f0000000101ef-8-4a7f3df920d68"
Accept-Ranges: bytes
Content-Length: 8
Content-Type: text/html
新建网页 //注意:此时连接并没有立即断开,还可以继续发送请求消息
GET /a.html  //简单的请求消息:不需要版本信息,返回后立即断开连接.

新建网页
失去了跟主机的连接。
阅读(613) | 评论(0) | 转发(0) |
0

上一篇:HTTP简介1

下一篇:Flex弹出窗口数据交互

给主人留下些什么吧!~~