Gotify 消息推送 API

xy506 3小时前 15

import console; 
function http_request(title,message,priority){
    import web.rest.client;
    var url = "http://localhost:8008/message?token=<apptoken>";
    var http = web.rest.client();
    // 请求头
    http.setHeaders({
        'Content-Type': 'application/json'
    });
    var Request = http.api(url);
    // 请求方式,返回结果
    var resp = Request.post(
    '{"message": "'++ message ++'", "title": "'++ title ++'", "priority":'++ priority ++', "extras": {"client::display": {"contentType": "text/markdown"}}}'
    );
    return resp;
};

TITLE="aardio主题"; //消息主题
MESSAGE="Hello: ![]( //Gotify 支持 Text 文本和 Markdown 文本。 
PRIORITY=5;   // priority 越大,消息提醒优先级越高

var data = http_request(TITLE,MESSAGE,PRIORITY)
console.varDump(data)
console.pause();


最新回复 (0)
返回