用 json 格式的 payload
类似这样的
[
{
"id": "803e95821262ec23",
"type": "function",
"z": "5bfc1ec08cb3472e",
"name": "钉钉消息预处理",
"func": "var message='湿度差:' + msg.payload[2]\n+ ' %,湿度差过大,请进行户外活动!';\nmessage += '\\n室内湿度:' + msg.payload[0] + ' %';\nmessage += '\\n户外湿度:' + msg.payload[1] + ' %\\n';\n\nmsg.payload = {\n "msgtype": "text", \n "text": {\n "content": message\n }, \n "at": {\n "isAtAll": true\n }\n}\n\nmsg.headers={\n 'Content-Type':'application/json',\n}\n\nmsg.url='https://oapi.dingtalk.com/robot/send?access_token=yourtoken';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1000,
"y": 560,
"wires": [
[
"7c98e4ba6db6c234"
]
]
},
{
"id": "7c98e4ba6db6c234",
"type": "http request",
"z": "5bfc1ec08cb3472e",
"name": "POST 请求",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"x": 1190,
"y": 560,
"wires": [
[]
]
}
]
|