Parent

Files

Class/Module Index [+]

Quicksearch

Chef::HTTP::HTTPRequest

Attributes

headers[R]
http_client[R]
http_request[R]
method[R]
url[R]

Public Class Methods

new(method, url, req_body, base_headers={}) click to toggle source
# File lib/chef/http/http_request.rb, line 75
def initialize(method, url, req_body, base_headers={})
  @method, @url = method, url
  @request_body = nil
  build_headers(base_headers)
  configure_http_request(req_body)
end
user_agent() click to toggle source
# File lib/chef/http/http_request.rb, line 69
def self.user_agent
  @user_agent ||= DEFAULT_UA
end
user_agent=(ua) click to toggle source
# File lib/chef/http/http_request.rb, line 65
def self.user_agent=(ua)
  @user_agent = ua
end

Public Instance Methods

call() click to toggle source

DEPRECATED. Call request on an HTTP client object instead.

# File lib/chef/http/http_request.rb, line 103
def call
  hide_net_http_bug do
    http_client.request(http_request) do |response|
      yield response if block_given?
      response
    end
  end
end
config() click to toggle source
# File lib/chef/http/http_request.rb, line 112
def config
  Chef::Config
end
host() click to toggle source
# File lib/chef/http/http_request.rb, line 82
def host
  @url.hostname
end
path() click to toggle source
# File lib/chef/http/http_request.rb, line 98
def path
  @url.path.empty? ? SLASH : @url.path
end
port() click to toggle source
# File lib/chef/http/http_request.rb, line 90
def port
  @url.port
end
query() click to toggle source
# File lib/chef/http/http_request.rb, line 94
def query
  @url.query
end
uri_safe_host() click to toggle source
# File lib/chef/http/http_request.rb, line 86
def uri_safe_host
  @url.host
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.