PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

HTTP client

Zend_Service_Delicious uses Zend_Rest_Client for making HTTP requests to the del.icio.us web service. To change which HTTP client Zend_Service_Delicious uses, you need to change the HTTP client of Zend_Rest_Client.

Example 797. Changing the HTTP client of Zend_Rest_Client

<?php
$myHttpClient 
= new My_Http_Client();
Zend_Rest_Client::setHttpClient($myHttpClient);

When you are making more than one request with Zend_Service_Delicious to speed your requests, it's better to configure your HTTP client to keep connections alive.

Example 798. Configuring your HTTP client to keep connections alive

<?php
Zend_Rest_Client
::getHttpClient()->setConfig(array(
        
'keepalive' => true
));

Note

When a Zend_Service_Delicious object is constructed, the SSL transport of Zend_Rest_Client is set to 'ssl' rather than the default of 'ssl2'. This is because del.icio.us has some problems with 'ssl2', such as requests taking a long time to complete (around 2 seconds).

Zend Framework