Method: Chef::HTTP#initialize
- Defined in:
- lib/chef/http.rb
#initialize(url, options = {}) ⇒ HTTP
Create a HTTP client object. The supplied url is used as the base for all subsequent requests. For example, when initialized with a base url localhost:4000, a call to get with ‘nodes’ will make an HTTP GET request to localhost:4000/nodes
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/chef/http.rb', line 92 def initialize(url, = {}) @url = url @default_headers = [:headers] || {} @sign_on_redirect = true @redirects_followed = 0 @redirect_limit = 10 @keepalives = [:keepalives] || false @options = @nethttp_opts = [:nethttp] || {} @middlewares = [] self.class.middlewares.each do |middleware_class| @middlewares << middleware_class.new() end end |