Class: UrlHelper

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

Class Method Summary collapse

Class Method Details

.get_json_doc(base_url, path) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/url_helper.rb', line 4

def self.get_json_doc(base_url, path)
	connection = Faraday.new base_url do |conn|
	  conn.request :json
	  conn.response :json, :content_type => /\bjson$/
	  conn.adapter Faraday.default_adapter
	end

	connection.get(path).body
end