试图从已弃用的 webhook 连接器过渡,我收到以下错误...
{"error":{"code":"InvalidRequestContent","message":"The input body for trigger 'manual' of type 'Request' must be of type JSON, but was of type 'applicaton/json'."}}
...按照此处的说明以及可用的 Teams 模板进行操作后,“收到 Webhook 请求时发布到频道。”。
$webhook = <webhook>;
$card = [
'text' => 'Hello world!'
];
$card = json_encode($card);
$c = curl_init($webhook);
curl_setopt_array($c, [
CURLOPT_POSTFIELDS => $card,
CURLOPT_HTTPHEADER => ['Content-type: applicaton/json'],
CURLOPT_RETURNTRANSFER => true
]);
$res = curl_exec($c);
curl_close($c);
die($res);