日期:2014-05-16  浏览次数:21493 次

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

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

但是服务器还是给我返回了一个gzip的压缩编码,请问我该如何修改,服务器才会给我明文的数据,不会给我gzip的编码

------解决方案--------------------
服务端设置死了你也没办法,gzip/deflate又省带宽又快,多好啊。
------解决方案--------------------
你的客户端程序把http请求包头的Accept-Encoding: gzip, deflate 去掉。

 
------解决方案--------------------
好像都是这个返回!顺便学习下!
------解决方案--------------------
RFC2616
HTML code

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.