diff --git a/README.md b/README.md index d024cea..76bf865 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,40 @@ foreach ($servers as $server) { ?> ``` +How to customize HTTP client configuration? +------------------------------------------- + +You can inject your own HTTP client with your specific configuration. For instance, you can edit user-agent and timeout for all your requests + +```php +setDefaultOption('timeout', 1); +$client->setDefaultOption('headers', array('User-Agent' => 'api_client') ); + +// Get servers list +$conn = new Api( $applicationKey, + $applicationSecret, + $endpoint, + $consumer_key, + $client); +$webHosting = $conn->get('/hosting/web/'); + +foreach ($webHosting as $webHosting) { + echo "One of our web hosting: " . $webHosting . "\n"; +``` How to build the documentation? -------------------------------