feat: 更新飞书通知

This commit is contained in:
eric
2022-12-14 14:18:53 +08:00
parent 360e27457b
commit 22a766d0ad

View File

@@ -1,4 +1,5 @@
from fastapi import FastAPI
import requests
app = FastAPI()
@@ -6,3 +7,14 @@ app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
# 飞书通知
@app.get("/feishu")
async def root():
headers = {'Content-Type': 'application/json'}
# https://open.feishu.cn/open-apis/bot/v2/hook/5fb1b44c-3446-42ef-9b3a-dd37731567dd
r = requests.post('https://httpbin.org/post',
data={'msg_type': 'text', "content": {"text": "request example"}}, headers=headers)
return {"message": "触发飞书webhook"}