How to make the ‘request’ filter work?

Inside your function, simply do a var_dump of the $request object to reveal its properties.