# class Chef::HTTP::HTTPRequest

### Constants

ACCEPT_ENCODING
DEFAULT_UA
DELETE
ENCODING_GZIP_DEFLATE
GET
HEAD
HOST_LOWER
HTTPS
POST
PUT
SLASH
UA_COMMON
USER_AGENT

### 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 73
    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 67
    def self.user_agent
      @user_agent ||= DEFAULT_UA
    end

user_agent=(ua) click to toggle source

    # File lib/chef/http/http_request.rb, line 63
    def self.user_agent=(ua)
      @user_agent = ua
    end

### Public Instance Methods

call() { |response| ... } click to toggle source

DEPRECATED. Call request on an HTTP client object instead.

    # File lib/chef/http/http_request.rb, line 101
    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 110
    def config
      Chef::Config
    end

host() click to toggle source

    # File lib/chef/http/http_request.rb, line 80
    def host
      @url.hostname
    end

path() click to toggle source

    # File lib/chef/http/http_request.rb, line 96
    def path
      @url.path.empty? ? SLASH : @url.path
    end

port() click to toggle source

    # File lib/chef/http/http_request.rb, line 88
    def port
      @url.port
    end

query() click to toggle source

    # File lib/chef/http/http_request.rb, line 92
    def query
      @url.query
    end

uri_safe_host() click to toggle source

    # File lib/chef/http/http_request.rb, line 84
    def uri_safe_host
      @url.host
    end