Webhook

主题:介绍什么是Webhook

英文引用: [What’s a Webhook by SendGrid Team](https://sendgrid.com/blog/whats-webhook/#:~:text=A webhook (also%20called%20a,meaning%20you%20get%20data%20immediately.&text=This%20makes%20webhooks%20much%20more%20efficient%20for%20both%20provider%20and%20consumer. "What’s a Webhook by SendGrid Team")

以下为中文译文
Webhook 也叫做WEB回调或HTTP 推送API, 提供了一种APP向另一个APP提供实时信息的方式。有时也被称为"反向API"
Webhook的优点

  • 实时
  • 高效
    Webhook的缺点
  • 初始设置较困难
  • 需要考虑安全性

Webhook Consumer需要提供一个开放的API消费事件,因此Webhook通常需要考虑安全性
常用的手段

  • 在url中增加auth参数
  • 实现 Basic Auth
  • 签名(需要Webhook提供方已经实现了签名功能)
posted @ 2021-09-06 22:10  dmyHero  阅读(240)  评论(0编辑  收藏  举报