def dispatch(self):
from flask import request<EOL>method = request.method<EOL>data = request.args<EOL>if method == '<STR_LIT:POST>':<EOL><INDENT>data = request.form<EOL><DEDENT>token = data.get('<STR_LIT>')<EOL>team_id = data.get('<STR_LIT>')<EOL>command = data.get('<STR_LIT>') or data.get('<STR_LIT>')<EOL>if isinstance(command, string_types):<EOL><INDENT>command = command.strip().lstrip('<STR_LIT:/>')<EOL><DEDENT>try:<EOL><INDENT>self.validate(command, token, team_id, method)<EOL><DEDENT>except SlackError as e:<EOL><INDENT>return self.response(e.msg)<EOL><DEDENT>func, _, _, kwargs = self._commands[(team_id, command)]<EOL>kwargs.update(data.to_dict())<EOL>return func(**kwargs)<EOL>
Dispatch http request to registerd commands.
        Example::

            slack = Slack(app)
            app.add_url_rule('/', view_func=slack.dispatch)