http协议二

来源:互联网 发布:有java基础学python 编辑:程序博客网 时间:2024/05/16 04:46
<!--GET /TEST/HELLO.HTML HTTP/1.1--请求行(发送的get请求,请求的资源/TEST/HELLO.HTML)--消息头Accept: */*(表示客户端扣接收任何数据类型)Referer: http://localhost:80/test/abc.html(表示我是从哪里来的)Accept-Language: zh-cn(页面接收什么语言)User-Agent:Mozilla/4.0(告诉服务器我的浏览器版本)Accept-Encoding:gzip, deflate(表示接收什么样的数据压缩格式)Host:localhost:80(主机:80)Connection: Keep-Alive(表示不要立即断掉我们的请求)http响应Location:http://www.baidu.com/index.phpServer:apacheContent-Encoding:gzip   (内容编码支持 gzip压缩算法)Content-Length:80       (返回数据大小)Content-Language:zh-cnContent-Type:text/html; charset=GB2312Last-Modified:Tue, 11 Jul 2000 18:23:51 GMT  (表示浏览器请求的资源最新更新时间)Refresh:1; url=http://www.baidu.com(告诉浏览器间隔1,重定向到baidu)//下面两个是文件下载相关Content-Disposition:attachment,filename=aaa.zipTransfer-Encoding:chuukedSet-Cookie:SS=Q0=5Lb_nQ;path=/search( Cookie)//下面三个共同控制不缓存Expires:-1Cache-Control:no-cachePragma:no-cache案例:<?php//通过header来禁用缓存(ajax)header("Expires:-1");header("Cache-Control:no_cache");header("Pragma:no-cache");echo 'hello! cache';?>-->
0 0
原创粉丝点击