diff --git a/app/main.py b/app/main.py index ee60be1..bb304f3 100644 --- a/app/main.py +++ b/app/main.py @@ -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"}