函数
var r = require('request');
var alertJson = {
"msgtype": "text",
"text": {
"content": "消息内容XX"
},
"at": {
"isAtAll": false
}
};
r({
method: 'POST',
uri: 'https://oapi.dingtalk.com/robot/send?access_token=XXXX',
headers: {
"content-type": "application/json"
},
json: alertJson
},
function(error, response, body) {
if (error) {
return console.error('发送请求[msg770]错误:', error);
}
console.log('发送请求[msg770]成功:', body);
});