Class: WCC::API::RestClient::HttpAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/wcc/api/rest_client/http_adapter.rb

Instance Method Summary collapse

Instance Method Details

#call(url, query, headers = {}, proxy = {}) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/wcc/api/rest_client/http_adapter.rb', line 9

def call(url, query, headers = {}, proxy = {})
  if proxy[:host]
    HTTP[headers].via(proxy[:host], proxy[:port], proxy[:username], proxy[:password])
      .get(url, params: query)
  else
    HTTP[headers].get(url, params: query)
  end
end