gpt4 book ai didi

Azure函数预编译函数,HttpRequestMessage未传递给函数

转载 作者:行者123 更新时间:2023-12-03 01:07:03 26 4
gpt4 key购买 nike

我有以下 F# 函数签名和函数开头

let Run(req: HttpRequestMessage, log: TraceWriter) =     
async {
log.Info("HttpRequestMessage" + req.ToString())
...

当我执行函数并打印 req 的值时,我得到

HttpRequestMessageMethod: GET, RequestUri: '<null>', Version: 1.1, Content: 
<null>, Headers:{ }

下面是我的 function.json 文件

{
"scriptFile": "../WonkTonkLib/wonktonkPostLib.dll",
"entryPoint": "PutUser.Run",
"bindings": [
{
"authLevel": "anonymous",
"name": "req",
"type": "httpTrigger",
"direction": "in",
"methods": [
"post"
]
},
{
"name": "res",
"type": "http",
"direction": "out"
}
],
"disabled": false
}

知道为什么请求消息没有传递给函数吗?如有任何帮助,我们将不胜感激。

最佳答案

请确保您的项目引用 System.Net.Http 4.1.1.0 而不是更高版本。

当前的工具和运行时都在更新,以在没有该要求的情况下解决这个问题,但与此同时,确保您匹配该版本应该可以解决这个问题。

关于Azure函数预编译函数,HttpRequestMessage未传递给函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45244575/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com