# File lib/fog/compute/ecloud.rb, line 318
        def request(params)
          # Convert the uri to a URI if it's a string.
          if params[:uri].is_a?(String)
            params[:uri] = URI.parse(@host + params[:uri])
          end
          host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ":#{params[:uri].port}" : ''}"

          # Hash connections on the host_url ... There"s nothing to say we won"t get URI"s that go to
          # different hosts.
          @connections[host_url] ||= Fog::XML::Connection.new(host_url, @persistent, @connection_options)

          # Set headers to an empty hash if none are set.
          headers = set_extra_headers_for(params) || set_extra_headers_for({})

          # Make the request
          options = {
            :expects => (params[:expects] || 200),
            :method  => params[:method] || "GET",
            :path    => params[:uri].path + "#{"?#{params[:uri].query}" if params[:uri].query}",
            :headers => headers
          }
          unless params[:body].nil? || params[:body].empty?
            options.merge!(:body => params[:body])
          end

          begin
            response = @connections[host_url].request(options)
          rescue Excon::Errors::Error => error
            raise ServiceError.slurp(error)
          end

          # Parse the response body into a hash
          unless response.body.empty?
            if params[:parse]
              document = Fog::ToHashDocument.new
              parser = Nokogiri::XML::SAX::PushParser.new(document)
              parser << response.body
              parser.finish

              response.body = document.body
            end
          end

          response
        end