---
title: "WebHook"
author: "Perrin Yong"
author_profile: https://www.pystone.net/profile/
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/webhook-basics/
type: note
content_role: unspecified
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/03-软件工程与质量保障/CI-CD与质量保障/CI-CD工具链/WebHook.md"
content_hash: 44ef8f50cf1c8572e827207b21302ea4d403b30cc7085366def7f153e136e7c0
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
# WebHook

﻿# WebHook

> 创建时间：2022/2/26 1:03

**位置：**| [ _31°14'37 N 121°23'17 E_](http://maps.google.com/maps?z=6&q=31.243546,121.388107)

  * Term
    * Wikipedia
    * 其他介绍
  * 用处
    * 接收事件信息并存储它
    * 接收事件信息并将其传递
  * CURL
  * Ref

## Term

### Wikipedia

A webhook in web development is a method of **augmenting or altering the behavior of a web page or web application with custom callbacks**.

这些回调可被可能与原始网站或应用相关的第三方用户及开发者保存、修改与管理。

> These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application.

The format is usually JSON. The request is done as a HTTP POST request.

Webhooks are "user-defined HTTP callbacks". They are usually triggered by some event, such as pushing code to a repository or a comment being posted to a blog. When that event occurs, the source site makes an HTTP request to the URL configured for the webhook. Users can configure them to cause events on one site to invoke behavior on another.

### 其他介绍

简单来说，Webhook 就是一个接收 HTTP POST（或GET，PUT，DELETE）的URL。是一个HTTP 回调：当事情发生时发生的 HTTP POST。该 URL 称为 webhook 端点
在大多数情况下，它们用于系统之间的通信。 这是在另一个系统中发生某些事情时获得警报的最简单方法。它们被称为网络钩子，因为它们在网络上作为软件钩子工作。

> 您的应用程序可以通过两种方式相互通信以共享信息：轮询和webhooks

## 用处

### 接收事件信息并存储它

### 接收事件信息并将其传递

## CURL

curl 是常用的命令行工具，用来请求 Web 服务器
CURL(Client URL) is a command-line tool for getting or sending data including files using URL syntax. Since cURL uses libcurl, it supports every protocol libcurl supports.

libcurl- a free client-side URL transfer library, supporting cookies, DICT, FTP, FTPS, Gopher, HTTP/1 (with HTTP/2 and HTTP/3 support), HTTP POST, HTTP PUT, HTTP proxy tunneling, HTTPS, IMAP, Kerberos, LDAP, MQTT, POP3, RTSP, RTMP, SCP, SMTP, and SMB.

用法：
https://www.ruanyifeng.com/blog/2019/09/curl-reference.html
https://www.ruanyifeng.com/blog/2011/09/curl.html
https://www.jianshu.com/p/07c4dddae43a

## Ref

https://en.wikipedia.org/wiki/Webhook
https://www.jianshu.com/p/9829986b4363
https://www.affde.com/zh-CN/what-is-webhook.html

https://en.wikipedia.org/wiki/CURL
