# File lib/fog/xml/sax_parser_connection.rb, line 23 def request(parser, params) reset unless @persistent # Prepare the SAX parser data_stream = Nokogiri::XML::SAX::PushParser.new(parser) response_string = "" params[:response_block] = lambda do |chunk, _remaining, _total| response_string << chunk if ENV["DEBUG_RESPONSE"] data_stream << chunk end # Make request which read chunks into parser response = @excon.request(params) Fog::Logger.debug "\n#{response_string}" if ENV["DEBUG_RESPONSE"] # Cease parsing and override response.body with parsed data data_stream.finish response.body = parser.response response end