Last active
February 24, 2017 02:45
-
-
Save paoga87/47649d822cb7d2e1fe083441e77e2ed3 to your computer and use it in GitHub Desktop.
This is an example of how the endpoint file looked like. This was set to capture the data SendGrid's webhook was sending.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('America/New_York'); | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
$myFile = "tmp/log.txt"; | |
$fh = fopen($myFile, 'a+') or die("can't open file"); | |
if ($fh){ | |
$headers = apache_request_headers(); | |
$postdata = file_get_contents("php://input"); | |
foreach ($headers as $header => $value) { | |
fwrite($fh, print_r("$header: $value \n", true)); | |
} | |
fwrite($fh, print_r($postdata, true)); | |
fclose($fh); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment