简体   繁体   中英

How can I print incoming webhook data in real-time on my browser?

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!

Consider using Request Bin , Webhook Site or Ngrok

All these tools allow you to generate a unique end point and see webhooks recieved in real time. However there are several benefits of using Ngrok opposed to online tools. It runs locally and allows you to forward data to your local application. So Ngrok will allow you to see webhooks data on local web page and you can also send the same data to your local PHP application simultaneously.

Ngrok Documentation

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM