[英]How to disable Content-type check in Apigility?
有一個ContentTypeFilterListener
偵聽器,用於檢查Apigility中的content-type
標頭。 我不需要它,通常會導致錯誤消息:
指定的內容類型無效。
有什么辦法可以完全禁用此功能?
ContentTypeFilterListener在此處的Module.php中的第46行使用attachAggregate
方法附加到EventManager
:
$em->attachAggregate($services->get('ZF\ContentNegotiation\ContentTypeFilterListener'));
這意味着您也可以使用detachAggregate
再次分離它:
$em->detachAggregate($services->get('ZF\ContentNegotiation\ContentTypeFilterListener'));
附加后,您應該可以執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.