azure-functions - 天蓝色函数 POST 方法是不允许的
问题描述
我使用 azure 函数开发了一个 web api <https://{api name}.azurewebsites.net> 并使用 VS Code 使用 POST 方法在本地对其进行了测试,它完全按照我的需要工作。但是,当我部署它(也来自 VS Code)以从邮递员那里测试和测试 POST 方法时,我收到一个405 METHOD NOT ALLOWED并且它看起来只适用于 GET。我可以看到该应用程序已从门户启动并运行,并且无法理解为什么仅当我进行以下设置时才将其限制为 GET:
# function.json
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}
任何帮助表示赞赏。我也对如何在 APP Services 下而不是在 Function APP 下部署 web api 感到困惑。我猜功能 APP 属于 APP 服务?
解决方案
推荐阅读
- laravel - Laravel:尝试上传多个文件时出错
- java - Java RMI Object/DTO 传输 ClassCastException
- javascript - 使用 .find() 方法根据 productId click 查找 productId 作为参数
- php - 我正在尝试从输入字段创建搜索功能,以搜索相关链接在一起的多个表
- r - 在处理平局时在数据框列中找到与给定数字最接近的“下限数字”
- db2 - 将数据加载到远程 DB2 服务器时出错
- javascript - 安装 date-fns 依赖项后出现错误
- php - 如何将woocommerce输入的最大属性设置为等于该产品的数量
- css - 如何使用线性渐变创建标志?
- javascript - 鼠标按下事件未在纸质 js 中触发