Parent

Files

Class/Module Index [+]

Quicksearch

Chef::REST::RESTRequest

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/rest/rest_request.rb, line 72
def initialize(method, url, req_body, base_headers={})
  @method, @url = method, url
  @request_body = nil
  @cookies = CookieJar.instance
  configure_http_client
  build_headers(base_headers)
  configure_http_request(req_body)
end
user_agent() click to toggle source
# File lib/chef/rest/rest_request.rb, line 66
def self.user_agent
  @user_agent ||= DEFAULT_UA
end
user_agent=(ua) click to toggle source
# File lib/chef/rest/rest_request.rb, line 62
def self.user_agent=(ua)
  @user_agent = ua
end

Public Instance Methods

call() click to toggle source
# File lib/chef/rest/rest_request.rb, line 97
def call
  hide_net_http_bug do
    http_client.request(http_request) do |response|
      store_cookie(response)
      yield response if block_given?
      response
    end
  end
end
config() click to toggle source
# File lib/chef/rest/rest_request.rb, line 107
def config
  Chef::Config
end
host() click to toggle source
# File lib/chef/rest/rest_request.rb, line 81
def host
  @url.host
end
path() click to toggle source
# File lib/chef/rest/rest_request.rb, line 93
def path
  @url.path.empty? ? SLASH : @url.path
end
port() click to toggle source
# File lib/chef/rest/rest_request.rb, line 85
def port
  @url.port
end
query() click to toggle source
# File lib/chef/rest/rest_request.rb, line 89
def query
  @url.query
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.