code: def _init_request_hooks(self):
          
          for method_type in ('pre', 'post'):
              for method in _METHODS:
                  event = getattr(self.app, 'on_' + method_type + '_' + method)
                  event_hook = getattr(hooks, method_type + '_' + method)
                  event += event_hook
docs: initialize pre request hooks