简体   繁体   English

用 wget 替换 curl 压缩数据

[英]Replace curl with wget for compressed data

We are using curl and we want to change to wget .我们正在使用curl并且我们想更改为wget

The curl command is like following: 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/  

I've tried with wget :我试过wget

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

But not sure regard compressed to get the same effect exactly in wget .但不确定在wget中是否考虑压缩以获得相同的效果。

wget has the --compression=type option: wget--compression=type选项:

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

For both curl and wget compression option adds Accept-Encoding header to a request.对于curlwget压缩选项,将Accept-Encoding header 添加到请求中。 curl adds Accept-Encoding: deflate, gzip, br and wget adds Accept-Encoding: gzip . curl添加Accept-Encoding: deflate, gzip, brwget添加Accept-Encoding: gzip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM