Skip to content

Commit 6811c2b

Browse files
committed
Updating README
1 parent 0dc1a4f commit 6811c2b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ need a Vonage account. Sign up [for free at vonage.com][signup].
1414
* [Logging](#logging)
1515
* [Exceptions](#exceptions)
1616
* [Overriding the default hosts](#overriding-the-default-hosts)
17+
* [HTTP Client Configuration](#http-client-configuration)
1718
* [JWT authentication](#jwt-authentication)
1819
* [Webhook signatures](#webhook-signatures)
1920
* [Pagination](#pagination)
@@ -179,6 +180,33 @@ client = Vonage::Client.new(
179180

180181
By default the hosts are set to `api.nexmo.com` and `rest.nexmo.com`, respectively.
181182

183+
### HTTP Client Configuration
184+
185+
It is possible to set configuration options on the HTTP client. This can be don in a couple of ways.
186+
187+
1. Using an `:http` key during `Vonage::Client` instantiation, for example:
188+
```ruby
189+
client = Vonage::Client.new(
190+
api_key: 'YOUR-API-KEY',
191+
api_secret: 'YOUR-API-SECRET',
192+
http: {
193+
max_retries: 1
194+
}
195+
)
196+
```
197+
198+
2. By using the `http=` setter on the `Vonage::Config` object, for example:
199+
```ruby
200+
client = Vonage::Client.new(
201+
api_key: 'YOUR-API-KEY',
202+
api_secret: 'YOUR-API-SECRET'
203+
)
204+
205+
client.config.http = { max_retries: 1 }
206+
```
207+
208+
The Vonage Ruby SDK uses the [`Net::HTTP::Persistent` library](https://github.com/drbrain/net-http-persistent) as an HTTP client. For available configuration options see [the documentation for that library](https://www.rubydoc.info/gems/net-http-persistent/3.0.0/Net/HTTP/Persistent).
209+
182210
### Webhook signatures
183211

184212
Certain Vonage APIs provide signed [webhooks](https://developer.vonage.com/en/getting-started/concepts/webhooks) as a means of verifying the origin of the webhooks. The exact signing mechanism varies depending on the API.

0 commit comments

Comments
 (0)