[英]HttpRequest object is null in response from Azure Function
This is my Azure function:这是我的 Azure function:
[FunctionName("CreateItem")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log)
{
string CompanyId = req.Query["CompanyId"];
string Table = req.Query["Table"];
string RowId = req.Query["RowId"];
string Key = req.Query["Key"];
string Action = req.Query["Action"];
string Arg = req.Query["Arg"];
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
When I look at the requestBody objcet in runtime, it is null. Why Is that?当我在运行时查看 requestBody 对象时,它是 null。这是为什么?
Thank you James Gould and Kresten .谢谢James Gould和Kresten 。 Posting your discussions as answer to help other community members.将您的讨论作为答案发布,以帮助其他社区成员。
The Actual request was not passing the body.实际请求没有传递正文。 Its just passing the query string.它只是传递查询字符串。 That's the reason why requestBody objcet in runtime is null这就是为什么 requestBody objcet 在运行时是 null 的原因
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.