    # File lib/stella/client.rb, line 246
        def prepare_request uc, rt
          clear_previous_request
          @rt = rt
          @vars.merge! uc.class.session || {}
          registered_classes = []
          if uc.class.testplan
            @vars.merge! uc.class.testplan.class.session || {}
            registered_classes = uc.class.testplan.class.registered_classes || []
          end
          registered_classes.push *(uc.class.registered_classes || [])
          registered_classes.each do |klass|
            self.extend klass unless self.kind_of?(klass)
          end
          @http_method, @params, @headers = rt.http_method, rt.params, rt.headers
          @http_auth = uc.http_auth
          instance_exec(&rt.callback) unless rt.callback.nil?
          @uri = if @redirect_uri
            @params = {}
            @headers = {}
            @http_method = :get
            if @redirect_uri.scheme
              tmp = [@redirect_uri.scheme, '://', @redirect_uri.host].join
              tmp << ":#{@redirect_uri.port}" unless [80,443].member?(@redirect_uri.port)
              @base_uri = Addressable::URI.parse(tmp)
            end
            build_uri @redirect_uri
          else
            build_uri @rt.uri
          end
          if !http_auth.nil? && !http_auth.empty?
            Stella.ld " HTTP AUTH: #{http_auth.inspect}"
            http_auth[:domain] ||= '%s://%s:%d%s' % [base_uri.scheme, base_uri.host, base_uri.port, '/']
            http_client.set_auth http_auth[:domain], http_auth[:user], http_auth[:pass]
            Stella.ld "   #{http_client.www_auth.inspect}"
          end
          @redirect_uri = nil  # one time deal
        end