V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Tianpu
V2EX  ›  Linux

Curl wget 会自动解压缩gzip压缩,怎么才可以得到原始文档?

  •  
  •   Tianpu · 2013-01-30 19:55:52 +08:00 via iPhone · 8069 次点击
    这是一个创建于 4098 天前的主题,其中的信息可能已经有所发展或是发生改变。
    前端A节点使用Nginx的proxy cache加速后端B节点

    A B 都使用了Gzip 所以我想确定没有多次压缩
    第 1 条附言  ·  2013-01-30 20:40:13 +08:00
    curl -H可以发送自定义header,感谢binux,看文档不仔细,大家要引以为戒
    2 条回复    1970-01-01 08:00:00 +08:00
    binux
        1
    binux  
       2013-01-30 20:17:17 +08:00   ❤️ 1
    我怎么不知道curl和wget会自动解压gzip?
    curl -H 'Accept-Encoding:gzip' http://somewhere.com/
    Tianpu
        2
    Tianpu  
    OP
       2013-01-30 20:38:48 +08:00
    @binux 非常感谢

    >curl -H 'Accept-Encoding:gzip' www.domain.com > temp
    >gzip -d temp
    >cat temp

    一次解压后看到全是明文 是不是表示只经过一次压缩了?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2832 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 12:52 · PVG 20:52 · LAX 05:52 · JFK 08:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.