什么是Webhook,我为什么要关心?
我能找到的最好的是 wiki条目
我认为肯定必须有比这更多。
I I thought "surely there must be more to it than this".
我错过了什么?
来自 doc :
什么是WebHook?
WebHook的概念很简单。 WebHook是一个HTTP回调:发生某些事情时发生的
HTTP POST;通过HTTP POST进行简单的事件通知。
The concept of a WebHook is simple. A WebHook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST.
实现WebHooks的Web应用程序会在发生某些事情时将消息发布到URL
。当一个Web应用程序使用户能够
注册他们自己的URL时,用户就可以扩展,定制,并且
将该应用程序与他们自己的自定义扩展集成,甚至可以与Web上的其他应用程序集成
。对于用户来说,WebHooks是一种
的方式来接收有价值的信息,而不是
持续轮询该数据并且没有收到任何有价值的大多数
的时间。 WebHooks具有巨大的潜力,仅限于你想象中的
! (不,它不能洗碗。但是。)
A web application implementing WebHooks will POST a message to a URL when certain things happen. When a web application enables users to register their own URLs, the users can then extend, customize, and integrate that application with their own custom extensions or even with other applications around the web. For the user, WebHooks are a way to receive valuable information when it happens, rather than continually polling for that data and receiving nothing valuable most of the time. WebHooks have enormous potential and are limited only by your imagination! (No, it can't wash the dishes. Yet.)
我为什么要关心?
随着我们对网络的整合,今天的大多数网络应用程序都是以孤岛运作的。随着API的兴起,我们看到了mashup和应用程序之间的一些
集成度。但是,我们还没有看到
可编程网络的愿景:一个网络,你作为用户可以在应用程序之间获得
管道数据,就像Unix命令行一样。有人说RSS
就是答案。他们错了。心脏在正确的位置,但实施是错误的
。 RSS仍然很有用,但是为我们带来真正的可编程网络并不是
。
As integrated as we perceive the web, most web applications today operate in silos. With the rise of API's we've seen mashups and some degree of integration between applications. However, we have not seen the vision of the programmable web: a web where you as the user can "pipe" data between apps much like the Unix command line. Some say RSS is the answer. They are wrong. The heart is in the right place, but the implementation is wrong. RSS is still useful, but it is not going to bring us the true programmable web.
我们只需要一种简单的方法来实时获取数据,让用户轻松地做任何他们想要的事情。这意味着没有轮询,没有内容约束,也没有XML
解析。这意味着没有RSS。使用HTTP更简单,更易于使用。
PHP是一个非常流行且易于访问的编程环境,所以它经常用于编写hooklet的
...从PHP中获取
web POST的数据就像$ _POST一样简单[ 东西。向用户脚本发出
请求就像发出HTTP请求一样简单,
已经内置到大多数编程环境中。实际上,
web钩子比API更容易实现。
We just need a simple way to get data out in real-time to let the user easily do whatever >they wantwith it. That means no polling, no content constraints, and no XML parsing. That means no RSS. Using HTTP is simpler and easier to use. PHP is a very popular and accessible programming environment, so it's likely to be used often for writing hooklets... getting data from a web POST in PHP is as simple as $_POST['something']. And making the request to the user script is as simple as making an HTTP request, something already built-in to most programming environments. In fact, web hooks are easier to implement than an API.