Webhooks 是一种样式/模式还是一种规范?
我一直在阅读有关 Webhooks 的内容,并试图确定它是规范还是样式/模式。
我所说的“规范”是指明确定义了实现细节,例如标头、有效负载等。我所说的“风格”或“模式”是指 REST 是一种风格(而不是规范)或一种描述用法但不定义实现细节的模式。
在我看来,Webhooks 是一种风格/模式。触发 http 回调的事件是按照开发人员想要的方式生成的,并且 http 回调除了作为 http post 之外没有特定的实现要求。
这是正确的吗?
I've been reading about Webhooks and I'm trying to determine if it's a specification vs a style/pattern.
By "specification" I mean that the implementation details, e.g. headers, payload and so on are well defined. By "style" or "pattern" I mean in the sense that REST is a style (as opposed to a spec) or a pattern which describes usage but doesn't define implementation details.
From what I see, Webhooks is a style/pattern. That the event(s) which triggers the http callbacks are generated however the developer wants, and that the http callbacks have no specific implementation requirements except to be an http post.
Is this correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正确的。您会发现这种风格的不同实现,例如,HTTP 回调请求的内容(格式)和“接收”回调的 URL 存在差异。在 RESTful 风格中,回调将是 HTTP POST,但传输的表示形式可以根据您的想象而变化。
我想你已经看到了 WebHooks 工作区,清楚地描述了概念。该页面提到:
此页面 有关 WebHooks 子集(即 RESTful WebHooks)的更多信息。
Correct. You'll find different implementations of this style, e.g. with differences in the content (format) of the HTTP callback request and the URL 'receiving' the callback. In a RESTful style, the callback will be a HTTP POST, but the representation that is transferred can be as variable as your imagination.
I think you've seen the WebHooks workspace, describing the concept clearly. That page mentions:
This page has more information on a subset of WebHooks, being RESTful WebHooks.
Svix(Webhooks 即服务平台)刚刚发布了标准 Webhooks 提案:https://www.standardwebhooks.com/,另请参阅博客文章:https://www.svix.com/blog/standard-webhooks/
Svix (a webhooks as a service platform) just released a standard webhooks proposal: https://www.standardwebhooks.com/, also see blog post: https://www.svix.com/blog/standard-webhooks/
您还可以查看 OpenID 基金会的共享信号和事件工作组规范,这是安全 Webhook 的标准:
https ://openid.net/wg/sse/
You can also look at the OpenID Foundation's Shared Signals and Events working group specifications, which is a standard for secure webhooks:
https://openid.net/wg/sse/