我正在尝试通过卡片从用户那里获取一些信息,目标 url 正在接收一个空白的发布请求而不是用户输入。这里是代码
requests.post(url="incoming webhook",
json=
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"summary": "John Doe",
"title": "input",
"potentialAction": [
{
"@type": "ActionCard",
"name": "Change status",
"inputs": [{
"@type": "MultichoiceInput",
"id": "list",
"title": "Select a status",
"isMultiSelect": "true",
"style":"compact",
"choices": [{
"display": "OBE",
"value": "OBE"
}, {
"display": "OUI",
"value": "OUI"
}, ]
}],
"actions": [{
"@type": "HttpPOST",
"name": "Save",
"target": "aworkingurl",
}]
}]})
我使用的 url 来自一个名为 webhooks.site 的站点,该站点提供了接受 POST 和 GET 请求的 url,该站点显示已尝试 POST 但内容为空,但是当我将一些字符串发布到同一个 url 时,它显示数据就好了。