class HTTParty::Request

def setup_raw_request

def setup_raw_request
  if options[:headers].respond_to?(:to_hash)
    headers_hash = options[:headers].to_hash
  else
    headers_hash = nil
  end
  @raw_request = http_method.new(request_uri(uri), headers_hash)
  @raw_request.body_stream = options[:body_stream] if options[:body_stream]
  if options[:body]
    body = Body.new(
      options[:body],
      query_string_normalizer: query_string_normalizer,
      force_multipart: options[:multipart]
    )
    if body.multipart?
      content_type = "multipart/form-data; boundary=#{body.boundary}"
      @raw_request['Content-Type'] = content_type
    end
    @raw_request.body = body.call
  end
  @raw_request.instance_variable_set(:@decode_content, decompress_content?)
  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