Webhooks 是一种样式/模式还是一种规范?

发布于 2024-09-03 19:26:41 字数 252 浏览 10 评论 0原文

我一直在阅读有关 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

像你 2024-09-10 19:26:42

正确的。您会发现这种风格的不同实现,例如,HTTP 回调请求的内容(格式)和“接收”回调的 URL 存在差异。在 RESTful 风格中,回调将是 HTTP POST,但传输的表示形式可以根据您的想象而变化。

我想你已经看到了 WebHooks 工作区,清楚地描述了概念。该页面提到:

没有规格?!
虽然目前有
没有为 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:

No Specs?!
While there are currently
no standards defined for WebHooks,
there are groups working to define
guidelines that may one day evolve
into standards. Each of these
standards should apply to different
types of needs, or lighter vs
comprehensive implementations.

This page has more information on a subset of WebHooks, being RESTful WebHooks.

池木 2024-09-10 19:26:42

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/

笑,眼淚并存 2024-09-10 19:26:42

您还可以查看 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文