import json
import requests
wecom_api_url ="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=*****"
headers = {'Content-Type': 'application/json;charset=utf-8'}
payload = {
"msgtype": "text",
"text": {
"content": "测试语句"
},
}
res = requests.post(wecom_api_url, json.dumps(payload), headers=headers)
print(res.status_code)
print(res.text)
wecom_api_url 后面输入的是你的webhook地址