I am trying to download a zip file using curl in java
public static void main(String[] args) throws Exception {
String url = "https://abcd.com ";
String[] command = {
"curl",
" -X ", "POST ",
"-H ", "\"Content-Type: application/json\" ",
"-H ","Accept:application/json ",
"-H ", "Accept-Encoding:gzip ",
"-d' ", url,
" >> "," /Users/myUser/Documents/Test1.gzip"};
Process p = Runtime.getRuntime().exec(command);
p.exitValue();
}
However nothing is getting triggered . Please let me know if I have missed anything .
When I am running the same command from terminal, the zip file is getting downloaded .