I have two curl commands to execute. The second command needs to "remember" the login made by the first one. I do not know about curl but I think the --cookie
parameter is doing the job.
well, curl is not for me. I need to do the same in Java but I can't rely in the environment ( cannot invoke /bin/sh -c curl
).
How can I do the same "login and still logged in" method in Java?
Already read this and this but both are "login every time will use".
curl -k -d "email=some@email.com&password=mysecret" -X POST 'https://some.site.com/index.php?some=parameter' --cookie "cookies.txt" --cookie-jar "cookies.txt"
curl -k "https://some.site.com/index.php?some=parameter" --cookie "cookies.txt" --cookie-jar "cookies.txt" --output test.tif