HTTP协议

HTTP协议

 http协议时建立在tcp协议之上的
 要先开启telnet的客服端,开启你的应用服务器
 GET /SoftWeb/index.jsp HTTP/1.1
 Host:localhost
 http1.0和http1.1的区别(1.0请求处理完tcp立刻断掉)

Accept text/html, application/xhtml+xml, /
Accept-Encoding gzip, deflate
Accept-Language zh-CN
Cache-Control no-cache
Connection Keep-Alive
Content-Length 31
Content-Type application/x-www-form-urlencoded
Cookie JSESSIONID=119D701F1F634502CBA4A8419A43BD1D
Host localhost:8080
Referer http://localhost:8080/WebPro2/index.jsp
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
请求 POST /WebPro2/servlet/DispatcherDemo HTTP/1.1

请求头
 GET /myweb/index.html HTTP/1.1(请求行)
消息头
 Accept-Encoding gzip, deflate
 Host localhost:8080
 User-Agent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
 Accept text/html, application/xhtml+xml, /
 Accept-Language zh-CN
响应头:
 HTTP/1.1 304 Not Modified(状态行)
消息头
 ETag W/“37-1368603309298”
 Content-Type text/html
 Content-Length 37
 Last-Modified Wed, 15 May 2013 07:35:09 GMT
 必须要有一个空行表示消息头结束
 内容
 < font color=“red”>adsfadsfadsf< /font >

 响应头的状态码
 HTTP请求中的常用响应头

Location: http://www.ttt.org/index.jsp
Server:apache tomcat
Content-Encoding: gzip
Content-Length: 80
Content-Language: zh-cn
Content-Type: text/html; charset=GB2312
Last-Modified: Tue, 11 Jul 2000 18:23:51 GMT
Refresh: 1;url=http://www.ttt.org
Content-Disposition: attachment; filename=aaa.zip
Transfer-Encoding: chunked
Set-Cookie:SS=Q0=5Lb_nQ; path=/search
Expires: -1
Cache-Control: no-cache
Pragma: no-cache
Connection: close/Keep-Alive
Date: Tue, 11 Jul 2000 18:23:51 GMT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值