#GET/POST
https://hayo.svip8.vip/send?token=token&title=测试消息标题&content=测试消息内容
import requests
params = {'token': '你的token;, 'title':'测试消息标题', 'content':'测试消息内容'}
resp = requests.get('https://hayo.svip8.vip/send', params=params)
print(resp.url)
# 输出: https://hayo.svip8.vip/send?token=token&title=测试消息标题&content=测试消息内容
package main
import (
"fmt"
"net/http"
"net/url"
)
func main() {
params := url.Values{}
params.Add("token", "你的token")
params.Add("title", "测试消息标题")
params.Add("content", "测试消息内容")
resp, err := http.Get("https://hayo.svip8.vip/send" + "?" + params.Encode())
if err != nil {
fmt.Println(err)
} else {
fmt.Println(resp.Request.URL)
}
}
<?php
$token = "你的token";
$title = "测试消息标题";
$content = "测试消息内容";
$baseURL = "https://hayo.svip8.vip/send";
$params = array(
"token" => $token,
"title" => $title,
"content" => $content
);
$url = $baseURL . "?" . http_build_query($params);
$resp = file_get_contents($url);
echo $url;
?>
let url = "https://hayo.svip8.vip/send?token=你的token&title=这是一条测试消息标题&content=测试消息内容"
let httpRequest = new XMLHttpRequest();
httpRequest.open('GET', url, true);
httpRequest.send();
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState === 4 && httpRequest.status === 200) {
var json = httpRequest.responseText; //获取到json字符串,还需解析
var jsonObject = JSON.parse(json);
alert(jsonObject.message)
}
};