#!/usr/bin/python
# coding=utf-8
import requests
import json


def mydingding(msg):
    data = {
        "msgtype": "text",
        "text": {
            "content": msg
        },
        "at": {
            "isAtAll": True
        }
    }

    requrl = 'https://oapi.dingtalk.com/robot/send?access_token=xxxxxx'
    print(requrl)
    HEADERS = {"Content-Type": "application/json ;charset=utf-8"}
    request = requests.post(url=requrl, data=json.dumps(data), headers=HEADERS)
    print(request.text)


msg = "好无聊啊！test"
mydingding(msg)
