Skip to content

Commit 81e5839

Browse files
lornajanemheap
authored andcommitted
Add custom guzzle client example to docs (#169)
1 parent f8582d2 commit 81e5839

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ print_r($response->data);
573573

574574
## Troubleshooting
575575

576+
577+
### `unable to get local issuer certificate`
578+
576579
Some users have issues making requests due to the following error:
577580

578581
```
@@ -592,6 +595,17 @@ curl.cainfo = "/etc/pki/tls/cacert.pem"
592595
curl.cainfo = "C:\php\extras\ssl\cacert.pem"
593596
```
594597

598+
### Pass custom Guzzle client
599+
600+
We allow use of any HTTPlug adapter, so you can create a client with alternative configuration if you need it, for example to take account of a local proxy, or deal with something else specific to your setup.
601+
602+
Here's an example that reduces the default timeout to 5 seconds to avoid long delays if you have no route to our servers:
603+
604+
```
605+
$adapter_client = new Http\Adapter\Guzzle6\Client(new GuzzleHttp\Client(['timeout' => 5]));
606+
$nexmo_client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic($api_key, $api_secret), [], $adapter_client);
607+
```
608+
595609
API Coverage
596610
------------
597611

0 commit comments

Comments
 (0)