azure - 在 Microsoft Azure 中使用 PowerApps 运行应用程序时出错

标签 azure powerapps text-analytics-api

我正在尝试使用 Microsoft azure 认知服务在 powerapps 上运行应用程序。这是一个情感分析应用程序,它根据我们输入的句子给出 0 到 1 之间的情感分析分数,其中 1 表示积极,0 表示消极。但是我尝试执行多少次都无法处理此错误:

TextAnalytics.DetectLanguage 失败:

{
  "code": "BadRequest",
  "message": "Invalid request",
  "innerError": {
    "code": "InvalidRequestQueryString",
    "message": "Request contains a query string. Request content should be placed in the request body, not in the url as a query string."
  }
}

如果有人对此错误有任何想法并知道如何处理它。请帮我执行这段代码。

最佳答案

从错误来看,您的请求格式不正确。该服务正在寻找以下格式的 POST 请求,听起来您正在发送参数化 URL。

根据to these docs ,请求的格式应为:

{
  "documents": [
    {
      "language": "en",
      "id": "1",
      "text": "Hello world. This is some input text that I love."
    },
    {
      "language": "fr",
      "id": "2",
      "text": "Bonjour tout le monde"
    },
    {
      "language": "es",
      "id": "3",
      "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer."
    }
  ]
}

与您的请求相比如何?

关于azure - 在 Microsoft Azure 中使用 PowerApps 运行应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55179755/

相关文章:

reactjs - 如何正确地将 ReactJS 应用程序部署为 Azure Web 应用程序

sharepoint - MS PowerApps 深度链接

api - PowerApps调用Azure API应用程序

ios - 我可以在 PlayStore 和 App Store 上运行发布的 Microsoft PowerApps 应用程序吗?

azure - 我们可以一起使用 LUIS 和文本分析 API

sql-server - 弹性作业代理在逻辑应用程序中执行作业时立即超时

c# - 部署后 Appsetting.json 无法与 Azure 函数应用一起使用

azure - 保存自定义模型 Azure 表单识别器时出错

sentiment-analysis - 我可以使用自定义的训练数据集将 Microsoft 文本分析训练为自定义版本吗?