Skip to content

Commit

Permalink
Add custom guzzle client example to docs (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
lornajane authored and mheap committed Apr 25, 2019
1 parent f8582d2 commit 81e5839
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ print_r($response->data);

## Troubleshooting


### `unable to get local issuer certificate`

Some users have issues making requests due to the following error:

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

### Pass custom Guzzle client

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.

Here's an example that reduces the default timeout to 5 seconds to avoid long delays if you have no route to our servers:

```
$adapter_client = new Http\Adapter\Guzzle6\Client(new GuzzleHttp\Client(['timeout' => 5]));
$nexmo_client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic($api_key, $api_secret), [], $adapter_client);
```

API Coverage
------------

Expand Down

0 comments on commit 81e5839

Please sign in to comment.