What encoding string tells a web server NOT to send gzip content?

后端 未结 2 973
醉酒成梦
醉酒成梦 2020-12-24 11:10

This encoding header tells a web server to send gzip content if available.

\'accept-encoding\': \'gzip,deflate,sdch\',

How can I instruct t

2条回答
  •  别那么骄傲
    2020-12-24 12:15

    Leaving the encoding out of accept-encoding will disallow that encoding (ie gzip).

    If you want to explicitly set it as disallowed, you can set a qvalue of 0.

    'accept-encoding': 'gzip;q=0,deflate,sdch'
    

    You can read more under accept-encoding in RFC2616, but in short if the server can't find an acceptable encoding among the ones listed (identity being a special case, see the link), it should send a 406 (Not Acceptable) response and not reply to your request with any other encoding.

提交回复
热议问题