DEV Community

Webhook is just a fancy way of saying 'event-driven server-to-server API calls' 🤦‍♀️ Explained in 1 min.

There is nothing new here. I could've ended my post right here because the title pretty much says it all. But I do want to shamelessly plug-in my side-project below so please read on.

We are all very familiar with how client-to-server API calls work. Yeah, I'm talking about those GET, POST, PUT http requests.

By the way, you can play with all kinds of API requests in that I created. It's a web-based Postman without native apps. Let me know what you think ❤️

Instead of client-to-server, webhooks are server-to-server API calls. Yeah, I'm talking about the same old GET, POST, PUT http requests, like above. But, the key difference is, since these calls are sent from a machine (server), they need to be triggered by events, aka hooks.

A common webhook example is, whenever a new commit is pushed to your Github repo, it triggers Github to make a call to your Jenkins server so it starts building the new code. Here we have a 'push-event driven Github-to-Jenkins API call'.

Alt Text

In this case Github will provide a JSON payload to Jenkins with all information about this new commit.

So next time you see some server uses webhooks, it simply means it can be triggered by some events to send some http request (API call) to another server.

Top comments (0)