gpt4 book ai didi

php - 如何读取webhooks发送的数据?

转载 作者:行者123 更新时间:2023-12-04 00:26:45 25 4
gpt4 key购买 nike

我有最新的 woocommerce 插件,我必须设置一个 webhook 到我的一个 URL。但是我无法在我的 $_REQUEST 和 $input = file_get_contents("php://input"); 中读取它。

最佳答案

$webhookContent = "";

$webhook = fopen('php://input' , 'rb');
while (!feof($webhook)) {
$webhookContent .= fread($webhook, 4096);
}
fclose($webhook);
mail('mail@yourdomain.com', 'test - hook', $webhookContent);

这就是全部。它会将所有正文发送到您的电子邮件

关于php - 如何读取webhooks发送的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30371270/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com