original_docstring: 
          Dispatches an incoming request and passes it to the relevant resource
          returning the response.
  
          :param app:
              Application handler. must be passed as part of the request
  
          :param payload:
              The request payload, contains all the parameters of the request
          
docstring: Dispatches an incoming request and passes it to the relevant resource
  returning the response.
docstring_tokens: Dispatches an incoming request and passes it to the relevant resource returning the response .
code: async def dispatch(self, app, payload):
          '''
          Dispatches an incoming request and passes it to the relevant resource
          returning the response.
  
          :param app:
              Application handler. must be passed as part of the request
  
          :param payload:
              The request payload, contains all the parameters of the request
          '''
          handler = None
          params = {}
          # parse request url, separating query params if any
          url = urlparse(payload['href'])
          path = url.path
          params.update(dict(parse_qsl(url.query)))
          params.update(payload.get('args', {}))
          # find the matching url , getting handler and arguments
          for route in self.urls(True, Resource.Protocol.websocket):
              match = re.match(route.path, path)
              if match:
                  handler = route.handler
                  params.update(match.groupdict())
                  break
          if handler:
              request = Request(
                  app=app,
                  key=payload.get('key', None),
                  method=payload.get('method', 'GET'),
                  url=path,
                  args=params,
                  headers=payload.get('headers', None),
                  body=payload.get('body', {})
              )
              response = await handler(request)
              return response
          return None
code_tokens: async def dispatch ( self , app , payload ) : handler = None params = { } url = urlparse ( payload [ 'href' ] ) path = url . path params . update ( dict ( parse_qsl ( url . query ) ) ) params . update ( payload . get ( 'args' , { } ) ) for route in self . urls ( True , Resource . Protocol . websocket ) : match = re . match ( route . path , path ) if match : handler = route . handler params . update ( match . groupdict ( ) ) break if handler : request = Request ( app = app , key = payload . get ( 'key' , None ) , method = payload . get ( 'method' , 'GET' ) , url = path , args = params , headers = payload . get ( 'headers' , None ) , body = payload . get ( 'body' , { } ) ) response = await handler ( request ) return response return None
short_docstring: Dispatches an incoming request and passes it to the relevant resource
  returning the response.
short_docstring_tokens: Dispatches an incoming request and passes it to the relevant resource returning the response .
comment: '''
          Dispatches an incoming request and passes it to the relevant resource
          returning the response.
  
          :param app:
              Application handler. must be passed as part of the request
  
          :param payload:
              The request payload, contains all the parameters of the request
          '''$SEP$# parse request url, separating query params if any$SEP$# find the matching url , getting handler and arguments