【发布时间】:2020-10-13 08:23:47
【问题描述】:
我按照此链接 How to upload a file in html page, using http trigger in azure functions using python? 上的描述构建了一些 html 文件,该文件能够向基于 python 的 azure 函数发送请求。但是,此解决方案使用了静态 Web 应用程序。
我更喜欢直接从本地 html 文件触发该功能,而不是托管网页。这样做时,我在 Chrome 中收到以下错误:
Access to XMLHttpRequest at 'https://FunctionName.azurewebsites.net/api/function' from origin 'null'
has been blocked by CORS policy: Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
有没有办法做到这一点?我使用的代码与上面的链接相同。
【问题讨论】:
标签: azure azure-web-app-service azure-functions