Configuration

Zend_Http_Client has configuration settings much like the context options of the HTTP streams wrapper, configuration settings of the cURL extension, and request options of the pecl_http extension. As shown in the example below, settings are declared in the form of an associative array of setting name-value pairs and can be passed either as the second parameter to the Zend_Http_Client constructor or later via its setConfig method.

<?php
$config = array('timeout' => 30);
// One way
$client = new Zend_Http_Client('http://localhost.example', $config);
// Another way
$client->setConfig($config);
?>

© Zend_Http_Client — Web Scraping

>>> Back to TABLE OF CONTENTS <<<
Category: Article | Added by: Marsipan (01.09.2014)
Views: 351 | Rating: 0.0/0
Total comments: 0
avatar