Sha256: a64650e6fb5e74c868d5aa78fa71229c6a030bd157dea2e5c9e88eaeae5187c5

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

require "forwardable" unless defined?(Forwardable)

require_relative "../http/simple"
require_relative "train/http"

module TargetIO
  class HTTP
    extend Forwardable
    def_delegators :@http_class, :get, :head, :patch, :post, :put, :delete

    # Only for Chef::Provider::RemoteFile::HTTP
    def_delegators :@http_class, :streaming_request, :streaming_request_with_progress, :last_response

    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chef-18.5.0 lib/chef/target_io/http.rb