Class: TargetIO::HTTP

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of HTTP.



14
15
16
17
18
19
20
# File 'lib/chef/target_io/http.rb', line 14

def initialize(url, http_client_opts = {})
  if ::ChefConfig::Config.target_mode?
    @http_class = TargetIO::TrainCompat::HTTP.new(url, http_client_opts)
  else
    @http_class = Chef::HTTP::Simple.new(url, http_client_opts)
  end
end