C
C
Coder3212016-12-09 03:11:37
JavaScript
Coder321, 2016-12-09 03:11:37

What is a webhook?

Can someone explain what a webhook is? Is it even better to explain and show the implementation in js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladlen Hellsite, 2016-12-09
@Coder321

Webhook is a mechanism for notifying the system about events.
Let's say there is a certain service that should notify about events when they occur.
As an option, constantly request new data on the server, the minus will be more likely in the speed of receiving data if the server, for example, has a delay in receiving new notifications.
But the webhook fixes this flaw, when an event occurs, it requests the site address with parameters, for example, example.com/webhook/notificationand passes JSON in the body of the POST request (often) and there will be fresh data.
You can see a simple example: creating a bot for telegram on webhooks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question