Created
September 24, 2019 02:43
-
-
Save vector4wang/48ff115414b652cdf13ab6940a753dd0 to your computer and use it in GitHub Desktop.
[钉钉机器人 python调用] #python #钉钉
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
_header = { | |
'Content-Type': 'application/json', | |
'charset': 'utf-8' | |
} | |
_data = { | |
'msgtype': 'text', | |
'text': { | |
'content': 'MaxComputer' | |
}, | |
'at': { | |
'atMobiles': [ | |
'18255062124' | |
] | |
} | |
} | |
json_data= json.dumps(_data).encode(encoding='utf-8') | |
print json_data | |
r = requests.post('https://oapi.dingtalk.com/robot/send?access_token=a1e6ea85c75e17240ec6cb1231fb4e525d86d5ecbfe0a0241ddb9f059e98fd23', | |
headers = _header, | |
data = json_data) | |
print r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment