什么编码字符串告诉Web服务器不要发送gzip内容? [英] What encoding string tells a web server NOT to send gzip content?

查看:124
本文介绍了什么编码字符串告诉Web服务器不要发送gzip内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 'accept-encoding':'gzip,如何指示Web服务器发送纯文本而不是gzip内容? 
我知道web服务器可以简单地忽略这个请求。

accept-encoding将禁止该编码(即gzip)。



如果您想明确地将其设置为不允许,您可以设置 qvalue 为0。

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

您可以在 RFC2616 ,但简而言之,如果服务器在列出的服务器中找不到可接受的编码(标识是一种特殊情况,请参阅链接),它应该发送一个406(不可接受)响应,而不是用任何其他编码回复你的请求。


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

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

How can I instruct the web server to send plain text and not gzip the content? I am aware that the web server can simply ignore this request if it wanted to.

解决方案

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.

这篇关于什么编码字符串告诉Web服务器不要发送gzip内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆