python 调用钉钉机器人的方法
以text格式的消息为例:(只需修改content后的内容)
Import json Import requests url='https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxxxx' HEADERS={"Content-Type":"application/json;charset=utf-8"} String_textMsg={"msgtype":"text","text":{"content":'kind:%s\naverage:%f\nmedian:%f\nQ10:%f\nQ90:%f'%("Trans",average,median,Q10,Q90)}} String_textMsg=json.dumps(String_textMsg) res=requests.post(url,data=String_textMsg,headers=HEADERS) print(res.text)
相关推荐
mysteryrat 2020-09-21
quyunfei 2020-11-19
机器人智力研究 2020-11-18
聊天终结者机器人 2020-11-18
txq0 2020-11-20
zCSDN 2020-11-09
机器人智力研究 2020-11-05
ARMOTO机器人 2020-11-06
txq0 2020-11-06
遇见人工智能 2020-11-03
聊天终结者机器人 2020-11-02
clliuhust 2020-10-30
yatou0 2020-10-29
雨燕 2020-10-29
nodid 2020-10-29
yatou0 2020-10-29
zCSDN 2020-10-27
dhyddy 2020-10-27