Method: Rev::HttpClient#initialize
- Defined in:
- lib/rev-api/http_client.rb
#initialize(client_api_key, user_api_key, host) ⇒ HttpClient
Create a new HttpClient, connecting to given host, and using the given Client and User API Keys.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rev-api/http_client.rb', line 16 def initialize(client_api_key, user_api_key, host) endpoint_uri = "https://#{host}/api/v1" self.class.base_uri(endpoint_uri) auth_string = "Rev #{client_api_key}:#{user_api_key}" @default_headers = { 'Authorization' => auth_string, 'User-Agent' => USER_AGENT # to track usage of SDK } end |