Ad

How Can I Print Incoming Webhook Data In Real-time On My Browser?

- 1 answer

I have set Webhook notification on Shopify platform when a new order is placed. I send the data to the URL of a PHP app I am currently working on and I want to print the incoming data in real-time on my browser. It is the first time I am working with Webhooks so any advice will be helpful. Thank you!

Ad

Answer

if you still need help with this: on the file you have set your webhook on use the following code to catch any incoming posts, you can print them or trigger them into your terminal.

$json = file_get_contents('php://input');
$data = json_decode($json,1);

i hope this helps you! Good day!

Ad
source: stackoverflow.com
Ad