http基础

1.http由五部分组成:请求行/状态行、通用头、请求头/响应头、实体头、实体主体
http请求:请求行 eg1:GET /index.html HTTP/1.1 eg2:POST http://ip/index.html HTTP/1.1
+通用头,请求头 eg:Host、user-Agent、Accept

+空行CRCF

+post实体头
+post实体内容eg: user=a&pwd=b


http响应:状态行 eg:HTTP/1.1 200 OK
+通用头,响应头 eg:Content-Type、Content-lenght

+空行CRCF
+实体头 eg:Content-Type:text/html、Content-lenght
+实体内容


缓存:减少请求、减少响应内容大小;Expires、Cache-control、last-Modified vs if-Modified-Since、ETag vs if-None-Match
proxy服务器:在用户浏览器 vs proxy服务器 vs 各大网站服务器

 

posted @ 2012-09-06 19:32  TovenZhou  阅读(210)  评论(0编辑  收藏  举报