我正在嘗試實施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響應。但我不能記錄任何東西。