public function onKernelLateRequest(GetResponseEvent $e)
    {
        if (!$this->enabled) return;

        $req = $e->getRequest();
        if (!$config = $req->attributes->get('_ac_web_service', false)) {
            return;
        }

        $config = $this->negotiateResponseFormat($req, $config);

        $req->attributes->set('_ac_web_service', $config);

        if (!isset($this->formatHeaders[$config['http_response_format']])) {
            throw new HttpException(415);
        }

        $e->getDispatcher()->dispatch(self::API_REQUEST, $e);
    }
public function onKernelLateRequest(GetResponseEvent $e)
    {
        if (!$this->enabled) return;

        $req = $e->getRequest();
        if (!$config = $req->attributes->get('_ac_web_service', false)) {
            return;
        }

        $config = $this->negotiateResponseFormat($req, $config);

        $req->attributes->set('_ac_web_service', $config);

        if (!isset($this->formatHeaders[$config['http_response_format']])) {
            throw new HttpException(415);
        }

        $e->getDispatcher()->dispatch(self::API_REQUEST, $e);
    }
public function onKernelLateRequest ( GetResponseEvent $ e ) { if ( ! $ this -> enabled ) return ; $ req = $ e -> getRequest ( ) ; if ( ! $ config = $ req -> attributes -> get ( '_ac_web_service' , false ) ) { return ; } $ config = $ this -> negotiateResponseFormat ( $ req , $ config ) ; $ req -> attributes -> set ( '_ac_web_service' , $ config ) ; if ( ! isset ( $ this -> formatHeaders [ $ config [ 'http_response_format' ] ] ) ) { throw new HttpException ( 415 ) ; } $ e -> getDispatcher ( ) -> dispatch ( self :: API_REQUEST , $ e ) ; }
Fires at the end of the `kernel.request` cycle - so listeners should receive a request that has already been
resolved to a controller.

Will throw exceptions if the response format is unknown.
Fires at the end of the kernel . request cycle - so listeners should receive a request that has already been resolved to a controller .