Skip to content

Instantly share code, notes, and snippets.

@vector4wang
Created September 24, 2019 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vector4wang/48ff115414b652cdf13ab6940a753dd0 to your computer and use it in GitHub Desktop.
Save vector4wang/48ff115414b652cdf13ab6940a753dd0 to your computer and use it in GitHub Desktop.
[钉钉机器人 python调用] #python #钉钉
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