I want to execute this curl command from a java application. I know I can use the Process Builder, but I dont know how to correctly format the command.
curl -X POST -d '{"user":"hello","command":"activate"}' "http://<examplewebaddress>"
This is what I have tried:
ProcessBuilder testCurlCommand = new ProcessBuilder("curl", "-X", "POST", "-d", "user=hello", "-d", "command=activate", "http://exampleweaddress>"
I have also tried many different variations of that incorporating the curly brackets, but it doesn't like that. Everything else works but I am unsure of the formatting for the arguments