Commit f3ca18a2 by fanxun

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	common/utils.py
parents 95104f7d e5a47c97
import requests
import json
from config import BaseConfig
def dingTalk(webhook, message):
"""发送消息到钉钉群"""
data = {'msgtype': 'text', 'text': {"content": message},
'at': {'isAtAll': True}}
post_data = json.dumps(data)
response = requests.post(webhook, headers=BaseConfig.headers, data=post_data)
return response.text
if __name__ == '__main__':
webhook = BaseConfig.webhook
message = '接口自动化这是测试数据再试试'
print(dingTalk(webhook, message))
class RedisBase:
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment