关于http请求中Accept-Encoding: gzip, deflate

DX_deepblue 2012-05-14 04:44:54

我不想服务器给我返回的是gzip的编码格式,
所以我将get请求中 Accept-Encoding: gzip, deflate 改成了 Accept-Encoding: none

但是服务器还是给我返回了一个gzip的压缩编码,请问我该如何修改,服务器才会给我明文的数据,不会给我gzip的编码
...全文
3558 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
youkuxiaobin 2012-05-14
  • 打赏
  • 举报
回复
RFC2616

A server tests whether a content-coding is acceptable, according to
an Accept-Encoding field, using these rules:

1. If the content-coding is one of the content-codings listed in
the Accept-Encoding field, then it is acceptable, unless it is
accompanied by a qvalue of 0. (As defined in section 3.9, a
qvalue of 0 means "not acceptable.")

2. The special "*" symbol in an Accept-Encoding field matches any
available content-coding not explicitly listed in the header
field.

3. If multiple content-codings are acceptable, then the acceptable
content-coding with the highest non-zero qvalue is preferred.

4. The "identity" content-coding is always acceptable, unless
specifically refused because the Accept-Encoding field includes
"identity;q=0", or because the field includes "*;q=0" and does
not explicitly include the "identity" content-coding. If the
Accept-Encoding field-value is empty, then only the "identity"
encoding is acceptable.
If no Accept-Encoding field is present in a request, the server MAY
assume that the client will accept any content coding.

设置为0,如果服务器返回的还是gzip的话,只能说web服务器不符合标准
zichen0422 2012-05-14
  • 打赏
  • 举报
回复
好像都是这个返回!顺便学习下!
恨天低 2012-05-14
  • 打赏
  • 举报
回复
你的客户端程序把http请求包头的Accept-Encoding: gzip, deflate 去掉。

qq120848369 2012-05-14
  • 打赏
  • 举报
回复
服务端设置死了你也没办法,gzip/deflate又省带宽又快,多好啊。

23,124

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧