Gotify 消息推送 API

xy506 6月前 699

Code AardioLine:24复制
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
    • 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();


    最新回复 (2)
    • aika107 6月前
      0 2
      不用返回信息的 curl -k "url" -F "title=Tit" -F "message=msg" -F "priority=5"
    • wxyrrcj 1月前
      1 3
      能否有大佬做一个 gotify 客户端 接收消息~ Winify 不太好用
    返回