php - How do I create a webhook? - Stack Overflow

PHOTO EMBED

Thu Feb 16 2023 20:37:32 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira #php

<?php
// Original Answer
header('Content-Type: application/json');
$request = file_get_contents('php://input');
$req_dump = print_r( $request, true );
$fp = file_put_contents( 'request.log', $req_dump );

// Updated Answer
if($json = json_decode(file_get_contents("php://input"), true)){
   $data = $json;
}
print_r($data);
?>
content_copyCOPY

https://stackoverflow.com/questions/45835797/how-do-i-create-a-webhook