Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// Simplest possible webhook/post relay thing
$forwardTo=[
'http://requestb.in/12qok4y1'
];
$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
You can’t perform that action at this time.