有一个ContentTypeFilterListener
侦听器在Apigility中检查content-type
头。我不需要它,并且经常导致错误消息:
指定的内容类型无效。
有什么办法可以完全禁用这个功能吗?
ContentTypeFilterListener使用attachAggregate
方法连接到Module.php第46行的EventManager
$em->attachAggregate($services->get('ZF'ContentNegotiation'ContentTypeFilterListener'));
这意味着您也可以使用detachAggregate
:再次分离它
$em->detachAggregate($services->get('ZF'ContentNegotiation'ContentTypeFilterListener'));
您应该能够在附加后执行此操作。