Using Zend_HTTP_Client instead of CURL
- by Vincent
All,
I want to use Zend_HTTP_CLient instead of CURL as there are issues with using curl on Solaris. I have the following curl code.. How will this code be written if I want to use Zend_HTTP_Client?
$ch = curl_init();
$devnull = fopen('/tmp/cookie.txt', 'w');
curl_setopt($ch, CURLOPT_STDERR, $devnull);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $desturl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,800);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$retVal = curl_exec($ch);
print_r(curl_error($ch));
curl_close($ch);
if ($devnull)
{
fclose($devnull);
}
Thanks