From 47655bb3aa536b3e6ec894c359705515bb8cf856 Mon Sep 17 00:00:00 2001 From: superchilled Date: Mon, 19 Jun 2023 12:32:42 +0100 Subject: [PATCH] Adding ua_addendum to README initialization opts --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 739b361..d85706e 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ opentok = OpenTok::OpenTok.new api_key, api_secret #### Initialization Options +**Custom Timeout** + You can specify a custom timeout value for HTTP requests when initializing a new `OpenTok::OpenTok` object: @@ -71,6 +73,23 @@ opentok = OpenTok::OpenTok.new api_key, api_secret, :timeout_length => 10 The value for `:timeout_length` is an integer representing the number of seconds to wait for an HTTP request to complete. The default is set to 2 seconds. +**UA Addendum** + +You can also append a custom string to the `User-Agent` header value for HTTP requests when initializing a new `OpenTok::OpenTok` +object: + +```ruby +require "opentok" + +opentok = OpenTok::OpenTok.new api_key, api_secret, :ua_addendum => 'FOO' +``` + +The above would generate a `User-Agent` header something like this: + +``` +User-Agent: OpenTok-Ruby-SDK/4.6.0-Ruby-Version-3.1.2-p20 FOO +``` + ### Creating Sessions To create an OpenTok Session, use the `OpenTok#create_session(properties)` method.