Convert Simple Php Class To Java 2

I have a PHP class which has some 4 methods that uses curl in php. I’d like to have it in JAVA. It’s very simple. Forexample a method in the php class is:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://www.google.com/accounts/ServiceLoginAuth”);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$output = curl_exec($ch);
curl_close($ch);

Leave a Reply

Your email address will not be published. Required fields are marked *