所有,我正在开发我的第一个Azure功能。该功能的目的是使用Bing认知API接收文本并对其进行拼写检查。但是,我无法编译,因为代码中的字符串text = req.GetQueryNameValuePairs()...行,因为它指出HTTPRequestMessage不包含“ GetQueryNameValuePairs”的定义,并且没有扩展方法“ GetQueryNameValuePairs”接受第一个参数可以找到类型“ HttpRequestMessage”(您是否缺少using指令或程序集引用?)。
任何帮助,将不胜感激。
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs.Host;
using Newtonsoft.Json;
using System.Net;
using System;
using System.Net.Http;
using System.Linq;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace SpellCheck.Functions
{
public static class SpellCheck
{
[FunctionName("SpellCheck")]
//public async static Task Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequest req, TraceWriter log)
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
//List<KeyValuePair<string, string>> …Run Code Online (Sandbox Code Playgroud)