【发布时间】:2017-05-12 18:34:37
【问题描述】:
我正在使用 aws ec2 服务器 (ubuntu)。它设置为对所有流量开放。我正在尝试从 HubSpot 获取我的 Webhook 以连接到我的 php 页面以收集数据。我已经用推荐的 RequestBin 站点测试了这个 webhook,所有数据都很好。所以这导致认为它是我的代码,或者可能是在用于通过终端连接到它的服务器上使用 SSL。
我的 php 代码是...
<?php
# taking data from HubSpot's webhook
//$hookData = json_decode(file_get_contents("php://input"), ture);
//$_POST = json_decode(file_get_contents("http://requestb.in/150jn861")); // does not get anything
//$_POST = file_get_contents('http://requestb.in/150jn861'); // writes to file the string "ok"
$_POST = json_decode(file_get_contents("php://input"), ture);
$file = fopen("datadump1.txt", "w");
fwrite($file, $_POST);
fclose($file);
var_dump($_POST); // test input
echo "\nTest completed\n";
?>
我在这里找到了另外 2 个关于 webhooks 和 hubspot 的帖子,但修复没有奏效。如您所见,我一直在测试多种东西,但没有任何工作。由于这是 aws ec2,我无法使用 var_dump 或 echo 来真正测试我想要的效果。我以前从未使用过这种类型的环境。提前感谢您提供的任何帮助。
【问题讨论】:
标签: php amazon-ec2 webhooks hubspot