Skip to content

Instantly share code, notes, and snippets.

@cillierburger
Created June 24, 2015 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cillierburger/a161947dc36c2e5bb884 to your computer and use it in GitHub Desktop.
Save cillierburger/a161947dc36c2e5bb884 to your computer and use it in GitHub Desktop.
<?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