class HTTParty::Request
def setup_raw_request
def setup_raw_request @raw_request = http_method.new(request_uri(uri)) @raw_request.body = body if body @raw_request.body_stream = options[:body_stream] if options[:body_stream] if options[:headers].respond_to?(:to_hash) headers_hash = options[:headers].to_hash @raw_request.initialize_http_header(headers_hash) # If the caller specified a header of 'Accept-Encoding', assume they want to # deal with encoding of content. Disable the internal logic in Net:HTTP # that handles encoding, if the platform supports it. if @raw_request.respond_to?(:decode_content) && (headers_hash.key?('Accept-Encoding') || headers_hash.key?('accept-encoding')) # Using the '[]=' sets decode_content to false @raw_request['accept-encoding'] = @raw_request['accept-encoding'] end end if options[:basic_auth] && send_authorization_header? @raw_request.basic_auth(username, password) @credentials_sent = true end setup_digest_auth if digest_auth? && response_unauthorized? && response_has_digest_auth_challenge? end