secure getFromServer is possible
This commit is contained in:
parent
95efd937f6
commit
86a37a89c6
1 changed files with 4 additions and 2 deletions
|
|
@ -50,9 +50,11 @@ async function getFromServer(bodyInfo, source="", secure=false, password=adminPa
|
||||||
}
|
}
|
||||||
let href = "";
|
let href = "";
|
||||||
if(secure) {
|
if(secure) {
|
||||||
href = "https://"+ip+"/"
|
href = "https://"+ip+"/" + source;
|
||||||
|
} else {
|
||||||
|
href = "http://"+ip+"/" + source;
|
||||||
}
|
}
|
||||||
const response = await fetch("http://"+ip+"/"+source, {
|
const response = await fetch(href, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(bodyInfo),
|
body: JSON.stringify(bodyInfo),
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue