Пинг сервера
Отправляет пинг на сервер.
Этот запрос не требует аутентификации. |
Пример
Запрос
-
Bash
-
JavaScript
-
NodeJS
-
Python
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/ping
curl -X GET $url
let saymonHostname = <...>
let path = "/node/api/ping";
let requestOptions = {
method: "GET"
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
const http = require("http");
let saymonHostname = <...>
let path = "/node/api/ping";
let options = {
"method": "GET",
"hostname": saymonHostname,
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
import requests
saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/ping"
response = requests.request("GET", url)
print(response.text)