zoukankan      html  css  js  c++  java
  • 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的例子吗?

  • 相关阅读:
    idea输出目录详解
    svn的使用教程
    java常用技术名词解析
    1.0 idea使用教程(配置)一
    fastDFS的搭建
    log4j的配置
    关于elementUI中上传组件点击上传时页面卡死的问题
    Nginx的反向代理
    给所有实体类重写tostring方法
    Nginx的配置
  • 原文地址:https://www.cnblogs.com/rader/p/5000385.html
Copyright © 2011-2022 走看看