Skip to content

Instantly share code, notes, and snippets.

@sawantuday
Created May 9, 2016 09:53
Show Gist options
  • Save sawantuday/19189dbffe66fe370895e17f4b70efc7 to your computer and use it in GitHub Desktop.
Save sawantuday/19189dbffe66fe370895e17f4b70efc7 to your computer and use it in GitHub Desktop.
Extract raw data from POST request.
<?php
$webhookContent = "";
$webhook = fopen('php://input' , 'rb');
while (!feof($webhook)) {
$webhookContent .= fread($webhook, 4096);
}
fclose($webhook);
echo $webhookContent;
// source: http://stackoverflow.com/questions/10937198/how-to-catch-the-http-post-request-sent-by-a-shopify-webhook
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment