When the server sends back the resulting content, the Content-Encoding header reveals to the browser the format used to compress the content.
当服务器发送回生成的内容时,Content - encoding头向浏览器说明压缩内容所用的格式。
The Content-Encoding header tells the browser that the response body is compressed using the gzip algorithm. After decompressing the blob, you’ll see the HTML you’d expect
内容编码头告诉浏览器整个响应体用gzip算法进行压缩。
Similarly, some systems transmit XML documents over HTTP without fully reading them but need to set the HTTP Content-type header to indicate the proper encoding.
类似地,有些系统通过http传输xml文档时,并没有全部读取文档,但需要设置HTTP的Content - type报头,指定正确的编码。
If it does, I will set the response header Content-Encoding to gzip and wrapper the response output stream with a gzip output stream.
如果支持,我将把响应头Content - Encoding设置为gzip并用gzip输出流把响应输出流包装起来。
The most common reason for them to be different is if the HTTP Content-type header specifies a different encoding than the one declared in the XML declaration.
最常见的原因是由于HTTP Content -type报头指定的编码与在XML声明中声明的编码不同。
I also need to check the HTTP header content-encoding to see if the server responded with GZIP.
我也需要检查http头content - encoding来看看服务器是否用GZIP响应。
Having modified the HTTP request to include the Accept-Encoding header with a value of GZIP, I need to modify the method used to read that content.
通过修改HTTP请求添加值为GZIP的Accept - encoding头之后,我需要修改用来读取内容的方法。
Thus, you will get a response, which include the response header name "Content-Encoding" and value "gzip", and need to ungzip the response data.
这样,你将会得到一个响应,根据消息头Content-Encoding为gzip你可以知道,传输过来的数据是经过gzip压缩的。
Thus, you will get a response, which include the response header name "Content-Encoding" and value "gzip", and need to ungzip the response data.
这样,你将会得到一个响应,根据消息头Content-Encoding为gzip你可以知道,传输过来的数据是经过gzip压缩的。
应用推荐