Registers HAL formats with the Request class.
\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The event to process.
public function onKernelRequest(GetResponseEvent $event) {
$request = $event
->getRequest();
$request
->setFormat('hal_json', 'application/hal+json');
}