import requests import json webhook_url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send' webhook_key = 'f09eb098-f709-4fc6-83b5-4a08a8431b8f' def send_wechat_message(message): response = requests.post( webhook_url, headers={ "Content-Type": "application/json" }, params={'key': webhook_key}, data=json.dumps(message, ensure_ascii=False).encode('utf-8') ) return response.json()