How to cURL a JAR from remote URL

后端 未结 1 2048
逝去的感伤
逝去的感伤 2021-02-15 01:47

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

相关标签:
1条回答
  • 2021-02-15 02:02

    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
    
    0 讨论(0)
提交回复
热议问题