【问题标题】:Bot Framework Composer HTTP request ErrorBot Framework Composer HTTP 请求错误
【发布时间】:2021-07-05 05:08:15
【问题描述】:

我正在 Bot framework composer 中开发聊天机器人。在那里,我需要调用 Azure 逻辑应用程序使用机器人框架编写器 HTTP 请求发送电子邮件。我确实需要配置但不起作用。请参阅附件了解更多详情。 更多详情请查看随附的屏幕截图。

错误代码

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

【问题讨论】:

    标签: botframework azure-logic-apps bot-framework-composer


    【解决方案1】:

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

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

    将您的 HTTP 方法更改为 POST 而不是 GET,然后再试一次。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多