我正在尝试实施Bigcommerce webhook,并且我成功地为webhook提供了商店/产品/更新*。当我试图在我的目标网址上获得响应时,我什么都没有。我使用下面的代码来记录webhook发送给我的url的响应。我的代码是Bigcommerce Webhook
<?php
$webhook_content = '';
$webhook = fopen('php://input' , 'rb');
while(!feof($webhook)){ //loop through the input stream while the end of file is not reached
$webhook_content .= fread($webhook, 4096); //append the content on the current iteration
}
fclose($webhook); //close the resource
$data=$webhook_content;
$data = json_decode($webhook_content,true); //convert the json to array
$myfile = __DIR__.'/productupdatelog.txt';
file_put_contents($myfile, print_r($data,true));
?>
但我仍然没有得到任何东西。 Bigcommerce团队正在说,检出我们确实发送的目标网址似乎在向您发送webhook,并正确地从您的服务器接收到200响应。但我不能记录任何东西。