【问题标题】:Bing Spell Check API Returns "Request Parameter Missing" ErrorBing 拼写检查 API 返回“请求参数缺失”错误
【发布时间】:2016-09-27 01:32:48
【问题描述】:

我正在尝试使用 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 microsoft-cognitive


    【解决方案1】:

    请尝试:

    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必须是小写的,并且表单字段必须这样指定。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-05
      • 2022-06-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多