Cloudflare Stream sending empty POST request

So I am trying to get webhooks working on my site so that every time cloudflare processes a video, it sends a POST request/notification. I have managed to get the notifications set up, however every time I upload a video the notification sent has no content at all. I tried recalling all POST and GET data using $_REQUEST in php, but it shows nothing (I have set it up to email me the contents of the requests).

Anyone have any ideas? Maybe I am doing this wrong, but the documentation/google is not revealing a lot of info.

Though $_REQUEST will contain it as well, you should use $_POST for POST requests.

However in this case Cloudflare wont send a form-encoded response (which is required to be parsed into $_POST) but a regular JSON formatted response.

The following might just do the trick (add error handling as you like)

$responseBody = file_get_contents('php://input');
$json = json_decode($responseBody);

I was using $_POST initially, I just wanted to see all the data sent and $_POST wasn’t showing anything.

Using the code you provided fixed it, thanks!