Azure APIM在API Post方法上获取CORS错误
我试图在我的web应用程序中使用POST API,但出现错误: 访问位于“”的XMLHttpRequesthttps://XXXXX“起源”http://localhost:3030'已被CORS策略阻止:对飞行前请求的响应未通过访问控制检查:请求的资源上不存在'access control Allow Origin'标头 以下是APIM中API级别的CORS设置:Azure APIM在API Post方法上获取CORS错误,cors,azure-web-app-service,azure-api-management,Cors,Azure Web App Service,Azure Api Management,我试图在我的web应用程序中使用POST API,但出现错误: 访问位于“”的XMLHttpRequesthttps://XXXXX“起源”http://localhost:3030'已被CORS策略阻止:对飞行前请求的响应未通过访问控制检查:请求的资源上不存在'access control Allow Origin'标头 以下是APIM中API级别的CORS设置: <policies> <inbound> <base /> <cors
<policies>
<inbound>
<base />
<cors allow-credentials="true">
<allowed-origins>
<origin>http://localhost:3030/</origin>
</allowed-origins>
<allowed-methods preflight-result-max-age="300">
<method>GET</method>
<method>POST</method>
<method>OPTIONS</method>
</allowed-methods>
<allowed-headers>
<header>*</header>
</allowed-headers>
</cors>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
http://localhost:3030/
收到
邮递
选择权
*
我不确定这里的设置是否错误。快速帮助将不胜感激
提前感谢。您应该在
Azure应用程序服务和APIM
中配置CRO
从api设置判断,应该没有问题。请检查您的webapp中的跨域设置
有关更多详细信息,您可以参考以下帖子查找您的问题。
从http到https的请求将导致混合内容错误,一些客户端会感到困惑,并将其显示为CORS错误,请尝试从https到https,看看这是否有助于解决问题,