WebHook implementation example?

Hussain ali picture Hussain ali · Sep 26, 2016 · Viewed 9.9k times · Source

Reviewer's Note

The title is exactly as it is supposed to be, even if the accepted answer suggests WebSockets.

We are building an application where customer will send data to our application. Our application have different events, like validating the data, saving it to data base and etc. I want to notify the client about the status of their data, like the data is validated, data is saved in SQL, etc. Our backend service will be in C#. I am new to this WebHook concept and have never implemented this before. I am looking for code examples for both sending and receiving side of WebHooks.

I would really appreciate any help.

Answer

Dan picture Dan · Sep 26, 2016

I think you are looking for WebSockets, and to 'push' notification to the client, the proven and most popular .NET solution is SignalR, last time I checked :)

There are alternatives too, GitHub search: websockets c#

Most WebSocket libs will fallback to legacy ways, like polling, when WebSockets are not supported.