Module: Helium::Client::Http

Included in:
Helium::Client
Defined in:
lib/helium/client/http.rb

Instance Method Summary collapse

Instance Method Details

#get(path = nil, url: nil, options: {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/helium/client/http.rb', line 4

def get(path = nil, url: nil, options: {})
  path = path.gsub(/^\//, '') if path
  url ||= "#{PROTOCOL}://#{HOST}/v#{API_VERSION}/#{path}"

  request = Typhoeus::Request.new(url, {
    params: options,
    headers: http_headers
  })

  run(request)
end