Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Simplest possible webhook/post relay thing
$post = file_get_contents('php://input');
foreach($forwardTo as $url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.isset($_SERVER["CONTENT_TYPE"]) ? $_SERVER["CONTENT_TYPE"] : 'text/plain'));
$result=curl_exec ($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment