I followed these tutorials How to use cURL in Java?, https://www.baeldung.com/java-curl to learn how to run curl from Java but it is not working.
The curl command (to delete page) is running fine from the terminal and gives a response in XML, but nada when I try in java, no error, no XML, the page also remains intact.
This is what I tried:
public class TryCurl {
static String command = "curl -u username:password -X POST -F cmd=\"deletePage\" -F path=\"/content/demo-task/section\" https://author1.dev.demo.adobecqms.net/bin/wcmcommand";
public static void main(String[] args) throws Exception {
Process process = Runtime.getRuntime().exec(command);
process.getInputStream();
process.destroy();
}
}
What am I doing wrong here?