def dispatch_request(self, *args, **kwargs):
        """Dispatch the incoming HTTP request to the appropriate handler.
        """
        self.args = args
        self.kwargs = kwargs
        self.meth = request.method.lower()
        self.resource = current_app.blueprints.get(request.blueprint, None)

        if not any([self.meth in self.methods, self.meth.upper() in self.methods]):
            return self.return_error(405)

        self.process_before_request_hooks()

        resp = super(Endpoint, self).dispatch_request(*args, **kwargs)
        resp = self.make_response(resp)

        resp = self.process_after_request_hooks(resp)

        return resp
def dispatch_request ( self , * args , ** kwargs ) : self . args = args self . kwargs = kwargs self . meth = request . method . lower ( ) self . resource = current_app . blueprints . get ( request . blueprint , None ) if not any ( [ self . meth in self . methods , self . meth . upper ( ) in self . methods ] ) : return self . return_error ( 405 ) self . process_before_request_hooks ( ) resp = super ( Endpoint , self ) . dispatch_request ( * args , ** kwargs ) resp = self . make_response ( resp ) resp = self . process_after_request_hooks ( resp ) return resp
Dispatch the incoming HTTP request to the appropriate handler.