Bing 拼写检查 API Returns "Request Parameter Missing" 错误

Bing Spell Check API Returns "Request Parameter Missing" Error

我正在尝试使用 Bing 的拼写检查 API 并将 运行 保留在这个错误中:

{"_type": "ErrorResponse", "errors": [{"code": "RequestParameterMissing", "message": "Required parameter is missing.", "parameter": "text"}]}% 

我正在使用 curl 发送请求并将其格式化为:

curl -v -X POST "https://api.cognitive.microsoft.com/bing/v5.0/spellcheck/?mode=Spell" -H "Content-Type: application/x-www/form-urlencoded" -H "Ocp-Apim-Subscription-Key: XXXXXXXXXXXXXXXXXXXX" --data-ascii "Text=Hello+Werld"

我真的不确定这里的问题是什么,所以任何帮助将不胜感激...提前致谢。

此外,这是我在 Microsoft 网站上查看的示例: https://dev.cognitive.microsoft.com/docs/services/56e73033cf5ff80c2008c679/operations/56e73036cf5ff81048ee6727

请尝试:

curl -v POST "https://api.cognitive.microsoft.com/bing/v5.0/spellcheck?mode=spell" -H "Ocp-Apim-Subscription-Key: $OXFORD_SPELL_KEY" --form "Text=Hello+Werld"

请注意 mode 必须为小写,并且表单字段必须如此指定。