this should now be ``$request->attributes->get('media_type');``

however it requires FOSRestBundle master with the format listener enabled.