Categories : Article, Dot Net Development
Last year, ASP.NET WebHooks preview joined ASP.NET stack as a new member, which was released to provide a simple publisher/subscriber model for binding together SaaS services and web APIs.
WebHooks is essentially a HTTP pattern and when an event occurs in a service, a notification is sent through HTTP POST over HTTP to the registered subscribers. The publisher/subscriber model is a messaging model wherein publishers cannot send messages to specific subscribers, but subscriber would receive only those messages/notifications that they want or subscribed to.
In the last quarter, ASP.NET WebHooks release was announced which is known for developing RESTful services that are required to send notifications and execute other tasks. Leveraging ASP.NET WebHooks, HTTP POST notification can be send within the context of ASP.NET runtime without requiring a constant network connection.
This functionality made ASP.NET WebHooks usable for leading online services like- GitHub, Trello, Dropbox, Salesforce, WordPress, and pretty more.
Let’s take a look how ASP.NET WebHooks works.
At first, WebHook publishers displays the event which WebHook subscribers can subscribe. Once, subscriber has subscribed, HTTP POSTS are sent to them when any event occurs. When WebHook receiver validate the request, HTTP POST is passed to WebHook handler. Later, WebHook handler enable your app to get the access to the data that’s sent via WebHook.
For instance, when someone sent you money through Paypal, you will receive a notification in real-time as Paypal will send POST request to the handler and then handler pass on this information to your pre-configured app.
Getting confused with handler and receiver? Don’t muddy the water anymore, here is the answer.
Handler are responsible to process the WebHooks, while receivers accept the WebHooks and check its integrity.
Seeing the functionality might make you think why WebHook is introduced, when SignalR was already there in ASP.NET for notifications.
In SignalR, remote procedure call (RPC) is used to send the notifications by establishing communication between client and server side. RPC enable server side application to notify client side with notifications or updates. SignalR can be used to provide notifications within a .NET app using websockets and only over constant network connectivity.
On the other hand, WebHooks leverage request response model to provide the notifications across web applications and other external services. The notifications are sent in real-time and there is no need to keep network connection open to wait for events.
It’s advantageous to use WebHook over SignalR. The plenty of tools, resources and information is available in the market that will help developers to start using this technology. To know more about WebHooks, click here.
Presently, ASP.NET application development is trending in the market and developers are trying their hands to build brilliant solution. The promising technology- ASP.NET WebHook is considered to solve myriad of challenges that pops-up when varied web applications and services are integrated. Besides, the support that WebHook is getting from leading online services enable developers to engineer such applications that can take benefit of available resources. So, blaze the ASP.NET WebHook trail and scale.
Happy ASP.NET WebHook development!