小编Mah*_*apa的帖子

验证内容返回 json 内容类型 Azure Api 管理策略的错误

我正在使用以下代码

    <validate-content unspecified-content-type-action="prevent" max-size="102400" size-exceeded-action="prevent" errors-variable-name="requestBodyValidation">
        <content type="application/json" validate-as="json" action="ignore" />
    </validate-content>
Run Code Online (Sandbox Code Playgroud)

在 api 管理策略中,但是当我发送带有 Content-Type 的请求时,application/json出现错误Unspecified content type application/json is not allowed

不确定问题所在,或者我对政策的理解错误。

有什么建议或解决方案吗?

validation content-type azure policies azure-api-management

0
推荐指数
1
解决办法
2815
查看次数