Bootstrap

python钉钉机器人发图片

图片地址必须是云上的或者网页可以查看的

def sendDingDing(mess,jpg_net_url):

    headers = {'Content-Type': 'application/json'}
    url = 'https://oapi.dingtalk.com'
    headers = {'Content-Type': 'application/json'}

    data = {
        "msgtype": "markdown",
        "markdown": {
            "title": "截图,aa",
            "text":
                "%s![O(∩_∩)O哈哈~](%s)"%(mess,jpg_net_url)

        },
 
    }
    data = json.dumps(data)
    try:
        request = requests.post(url, data, headers=headers)
    except:
        print('发送数据失败')
;