1

I'm trying to run an application on powerapps using Microsoft azure cognitive services. This is a sentimental analysis application where in it gives a sentimental analysis score between 0 to 1 where 1 being positive and 0 being negative based on the sentence we enter. But how much I try and execute I'm not able to handle this error:

TextAnalytics.DetectLanguage failed:

{
  "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."
  }
}

If anybody has any idea regarding this error and knows how to handle it. Please do help me out to execute this code.

Nishant
  • 7,504
  • 1
  • 21
  • 34
Student
  • 11
  • 1

1 Answers1

0

From the error, it sounds like your request is malformed. The service is looking for a POST request to be in the format below, sounds like you're sending a parameterized URL instead.

According to these docs, the request should be in the form of:

{
  "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."
    }
  ]
}

How does your request compare?

SeaDude
  • 3,725
  • 6
  • 31
  • 68