# File lib/merb-extjs-direct/mixins/remoting_provider.rb, line 82
        def rpc
            if !request.ajax? && !params["extAction"]
                return "Ext::Direct::RemotingProvider#rpc -- This method is an ajax-handler only"
            end

            is_form = false
            is_upload = false
            if params["extAction"] && params["extMethod"]
                # create fake response here.
                is_form = true
                is_upload = params.delete("extUpload") == 'true'

                request = {
                    "xcontroller"   => params.delete("extAction"),
                    "xaction"       => params.delete("extMethod"),
                    "type"          => "rpc",
                    "id"            => params.delete("id"),
                    "tid"           => params.delete("extTID"),
                    "format"        => params.delete("format"),
                    "data"          => params
                }
                params.delete('controller')
                params.delete('action')
                res = "<html><body><textarea>#{handle_request(request).gsub(/&quot;/, "\&quot;")}</textarea></body></html>"
                return res
            elsif (params[:inflated_object])
                # multiple requests found.  I'm not sure how this "inflated_object" mechanism works.  This is Merb magic?
                # controllers always return a string, so each response has already been json-encoded.
                # since we're dealing with multiple requests here, we have to manually string-concat-wrap the retured
                # string-of-json.
                #
                return "[" + params[:inflated_object].collect {|req| handle_request(req)}.join(',') + "]"
            else
                ##
                # just a single request found
                #
                return handle_request(params)
            end
        end