如何从远程URL卷曲JAR [英] How to cURL a JAR from remote URL

查看:62
本文介绍了如何从远程URL卷曲JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以从HTTP URL下载的JAR,例如 http://somerepo.example.org/myjar-1.0.jar



我需要一个cURL命令,将其下载到当前目录;到目前为止,我最好的尝试是:

  curl -i -H接受:application / zip -H内容类型: application / zip -X GET http://somerepo.example.org/myjar-1.0.jar 

当我运行此控制台时,我的控制台充满了二进制垃圾邮件,似乎导致整个终端崩溃。



GET的正确cURL命令是什么?来自远程URL的JAR?

解决方案

您已经快到了。默认情况下,cURL将下载内容输出到STDOUT。您要将其重定向到这样的文件:

  curl -H接受:application / zip http:// somerepo .example.org / myjar-1.0.jar> myfile.jar 

您也可以使用 -o 选项:

  curl -H接受:application / zip http://somerepo.example.org/myjar- 1.0.jar -o myfile.jar 

您还应该能够使用 wget

  wget http://somerepo.example.org/myjar-1.0.jar 


I have a JAR that is available for download from an HTTP URL, say, http://somerepo.example.org/myjar-1.0.jar.

I need a cURL command that will download it to the current directory; my best attempt thus far is:

curl -i -H "Accept: application/zip" -H "Content-Type: application/zip" -X GET http://somerepo.example.org/myjar-1.0.jar

When I run this my console fills with binary spam and seems to cause my entire terminal to have a melt down.

What is the correct cURL command to GET a JAR from a remote URL?

解决方案

You are almost there. By default cURL will output the download to STDOUT. You want to redirect this to a file like so:

curl -H "Accept: application/zip" http://somerepo.example.org/myjar-1.0.jar > myfile.jar

You can also use the -o option:

curl -H "Accept: application/zip" http://somerepo.example.org/myjar-1.0.jar -o myfile.jar

You should also be able to use wget

wget http://somerepo.example.org/myjar-1.0.jar

这篇关于如何从远程URL卷曲JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆