bocadillo.hooks

before

before(hook:Callable[[bocadillo.request.Request, bocadillo.response.Response, dict], Awaitable[NoneType]], *args, **kwargs)

Register a before hook on a handler.

Parameters

  • hook (callable): a hook function.

after

after(hook:Callable[[bocadillo.request.Request, bocadillo.response.Response, dict], Awaitable[NoneType]], *args, **kwargs)

Register an after hook on a handler.

Parameters

  • hook (callable): a hook function.