我需要手动解压缩以下页面的响应:http: //muaban.net/ho-chi-minh.html
我正在做
echo -e "GET /ho-chi-minh.html HTTP/1.1\r\nHost: muaban.net\r\nAccept-Encoding: gzip\r\n" | nc muaban.net 80 > response.txt
直到响应实际包含Content-Encoding: gzip
或Content-Encoding: deflate
标题(有时它只是纯文本),然后
cat response.txt | sed '1,14d' | zcat
但它说输入不是 gzip 格式。
以下是标题:
HTTP/1.1 200 OK
Cache-Control: public, max-age=67
Content-Type: text/html
Content-Encoding: deflate
Expires: Wed, 16 May 2012 15:20:31 GMT
Last-Modified: Wed, 16 May 2012 15:18:31 GMT
Vary: *
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
X-Proxy: 162
Date: Wed, 16 May 2012 15:19:23 GMT
Content-Length: 12618