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