version 1.60, 2024/03/29 21:23:10 |
version 1.61, 2024/03/29 21:25:18 |
Line 66 fetch("/feedbk/", { |
|
Line 66 fetch("/feedbk/", { |
|
headers: { "Content-Type": "application/json" }, |
headers: { "Content-Type": "application/json" }, |
body: dataToSend |
body: dataToSend |
}) |
}) |
.then(resp => { |
.then(dataRecieved => response.json()) |
if (resp.status === 200) { |
.then(json => console.log(dataRecieved)) |
return resp.json() |
|
} else { |
|
console.log("Status: " + resp.status) |
|
return Promise.reject("server") |
|
} |
|
}) |
|
.then(dataJson => { |
|
console.log(dataReceived); |
|
}) |
|
.catch(err => { |
|
if (err === "server") return |
|
console.log(err) |
|
}) |
|
|
|
//fetch('https://draft.hgk.global/feedbk/') |
|
// .then(response => response.json()) |
|
// .then(json => console.log(json)) |
|
|
|
|
|
|
|