def after_request(self, func: Callable, name: AppOrBlueprintKey=None) -> Callable:
        """Add an after request function.

        This is designed to be used as a decorator. An example usage,

        .. code-block:: python

            @app.after_request
            def func(response):
                return response

        Arguments:
            func: The after request function itself.
            name: Optional blueprint key name.
        """
        handler = ensure_coroutine(func)
        self.after_request_funcs[name].append(handler)
        return func