Class: TargetIO::HTTP::SimpleJSON

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/target_io/http.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, http_client_opts = {}) ⇒ SimpleJSON

Returns a new instance of SimpleJSON.



24
25
26
# File 'lib/chef/target_io/http.rb', line 24

def initialize(url, http_client_opts = {})
  @http_class = TargetIO::HTTP.new(url, http_client_opts)
end

Instance Method Details

#get(path, headers = {}) ⇒ Object



28
29
30
31
32
# File 'lib/chef/target_io/http.rb', line 28

def get(path, headers = {})
  response = @http_class.get(path, headers)

  Chef::JSONCompat.from_json(response)
end