def _check_method_and_params(self):
        """
        Check if the method in the request is one of the supported methods.

        Note:: Do not rename self.rpc_methods to self.methods as self.methods
        is reserved for the HTTP methods allowed for this class.
        """
        self.method = request.json["method"].lower()
        if(self.method not in self.rpc_methods):
            msg = "The method %s does not exist / is not available."
            return {"code":-32601, "message":msg % (request.json["method"])}

        self.params = request.json.get("params")
        if(not self.params):
            msg = "Invalid Request: parameters are required"
            return {"code":-32602, "message":msg}

        return None
dataset/ETHPy150Open pyjs/pyjs/examples/misc/flaskexamples/flaskcelery/flask_source/method_views.py/JSONRPCView._check_method_and_params/original