簡體   English   中英

如何在Apigility中禁用內容類型檢查?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM