Using Zend_HTTP_Client instead of CURL

Posted by Vincent on Stack Overflow See other posts from Stack Overflow or by Vincent
Published on 2010-03-25T18:10:12Z Indexed on 2010/03/25 18:13 UTC
Read the original article Hit count: 603

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about php5