1

我正在Bot framework composer开发聊天机器人。在那里,我需要使用 bot framework composer HTTP request调用Azure 逻辑应用程序来发送电子邮件。我确实需要配置,但不起作用。更多详情请参阅附件有关更多详细信息,请查找随附的屏幕截图。

错误代码

{“statusCode”: 400,
“reasonPhrase”: “Bad Request”,
“headers”: {
"Cache-Control": "no-cache",
"Pragma": "no-cache",
"x-ms-ratelimit-burst-remaining-workflow-reads": "19999",
"x-ms-ratelimit-remaining-workflow-download-contentsize": "1073741824",
"x-ms-ratelimit-time-remaining-directapirequests": "99999999",
"x-ms-request-id": "southeastasia:4b634b23-3f4f-4acc-9ac7-9ddf3b5534c5",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Date": "Fri, 09 Apr 2021 12:29:03 GMT"},
“content”: {
"error": {
"code": "TriggerRequestMethodNotValid",
"message": "The HTTP method for this request is not valid: expected 'Post' and actual 'GET'."}}}

下面显示了 Azure 逻辑应用中的请求正文 JSON 架构

{
    "properties": {
        "account": {
            "properties": {
                "ID": {
                    "type": "string"
                },
                "address": {
                    "properties": {
                        "city": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "number": {
                            "type": "string"
                        },
                        "postalCode": {
                            "type": "string"
                        },
                        "state": {
                            "type": "string"
                        },
                        "street": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "name": {
                    "type": "string"
                }
            },
            "type": "object"
        }
    },
    "type": "object"
}

下面显示了 Bot 框架作曲家 Body

{
   "account": {
      "name": "Contoso",
      "ID": "12345",
      "address": {
         "number": "1234",
         "street": "Anywhere Street",
         "city": "AnyTown",
         "state": "AnyState",
         "country": "USA",
         "postalCode": "11111"
      }
   }
}

在此处输入图像描述

在此处输入图像描述

4

1 回答 1

2

我相信问题已在您的错误响应 json 有效负载中确定:

"message": "The HTTP method for this request is not valid: expected 'Post' and actual 'GET'."}}}

将您的 HTTP 方法更改为POSTGET然后再试一次。

于 2021-04-09T18:23:31.053 回答