星空网 > 软件开发 > ASP.net

Asp.Net 5 Web Hook

 

首先,然我们来看一下WebHooks是什么。WebHooks是一个协议。它们是HTTP回调技术。并且它们是“用户定义的HTTP回调”。你和 (或) 您的应用程序在有什么事情发生时会发送通知,然后您的 URL 端点在那件事情发生的时候就会 收到一封HTTP 邮件。

--来自Scott Hanselman的博客 ASP.NET WebHooks Receivers 介绍-WebHooks 让其变得便捷

同样是通知机制,WebHook跟SingalR的区别在哪里:

SignalR is for notification within an ASP.NET app using WebSockets. You can exchange event notifications through WebSockets, however it requires a constant network connection.

WebHooks are for event notification across other web applications and other external services. (Think B2B communication). For instance, you can receive a WebHook when someone sends you money to your PayPal account. PayPal fires off a POST request to your predefined URL handler and then your app does something with that notification. You pre-configure everything on the PayPal side first. You also set up an application to handle the incoming POST request. The event notification is "pushed" to you in (near) real-time. No need to hold open a network connection while waiting for events.

The two can be complementary. For example, when you receive the WebHook from PayPal, you can notify a logged in user on your webapp (using SignalR/WebSockets) that money has been received successfully.

TLDR: Event notification across different web applications

-- from Difference between ASP.NET WebHooks and Signal-R

做过微信公众号开发的人应该熟悉WebHook的模式吧。微信要求我们为公众号设定一个回调地址,当有用户向公众号发送消息时,这个回调地址所指的服务器回收到来自微信的消息。这不就是一个WebHook的例子吗?




原标题:Asp.Net 5 Web Hook

关键词:ASP.NET

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Shopee高利润打法-附80%超高毛利率案例详细分析:https://www.goluckyvip.com/news/10413.html
跟每个Shopee卖家息息相关,虾皮CEO 看了也忍不住点赞:https://www.goluckyvip.com/news/10414.html
Tiktok玩家第123篇:快放假了,供应链和物流都需要停20来天,年前如何快人一步做好布局?:https://www.goluckyvip.com/news/104145.html
建议看完!Shopee赚钱的底层逻辑是什么?:https://www.goluckyvip.com/news/10415.html
Shopee选品这件事,你知道多少?:https://www.goluckyvip.com/news/10416.html
跨境兴运可为物流ERP提供哪些哪些支持? :https://www.goluckyvip.com/news/10417.html
五月电商盛宴:节假日营销策略解析与商机揭秘 :https://www.kjdsnews.com/a/1842215.html
2023年意大利在线销售额超800亿欧元,增长27.14%:https://www.kjdsnews.com/a/1842216.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流