Class: HttpAdapter

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

Instance Method Summary collapse

Instance Method Details

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



7
8
9
10
11
12
13
14
# File 'lib/rest_client/http_adapter.rb', line 7

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