【问题标题】:Replace curl with wget for compressed data将 curl 替换为 wget 以获取压缩数据
【发布时间】:2021-01-12 09:23:10
【问题描述】:

我们正在使用curl,我们想更改为wget

curl 命令如下:

curl -fsSLO --compressed "https://yarnpkg.com/downloads/v1.22.4/yarn-v$1.22.4.tar.gz" && \ mkdir -p /opt  && \
tar -xzf yarn-v1.22.4 -C /opt/  

我试过wget:

wget -c "https://yarnpkg.com/downloads/v1.22.4/yarn-v$1.22.4.tar.gz"  

但不确定是否在 wget 中完全压缩以获得相同的效果。

【问题讨论】:

  • HTTP request sent, awaiting response... 301 Moved Permanently

标签: linux bash dockerfile wget


【解决方案1】:

wget--compression=type 选项:

--compression=type
       Choose the type of compression to be used.  Legal values are auto, gzip and none.

对于curlwget 压缩选项将Accept-Encoding 标头添加到请求中。 curl 添加 Accept-Encoding: deflate, gzip, brwget 添加 Accept-Encoding: gzip

【讨论】:

    猜你喜欢
    • 2014-09-22
    • 2013-07-18
    • 1970-01-01
    • 2013-10-06
    • 1970-01-01
    • 2020-12-11
    • 2017-02-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多