=================================================================== RCS file: /cvs/cvs/draft/form.min.js,v retrieving revision 1.57 retrieving revision 1.63 diff -u -p -r1.57 -r1.63 --- draft/form.min.js 2024/03/29 21:16:42 1.57 +++ draft/form.min.js 2024/03/29 21:30:03 1.63 @@ -57,7 +57,7 @@ async function sendData() { //}); /* --------------------- */ //ovar re=""; -//const dataToSend = JSON.stringify({"email": "hey@mail.com", "password": "101010"}); +const dataToSend = JSON.stringify({"email": "hey@mail.com", "password": "101010"}); //let dataReceived = ""; //fetch("/feedbk/", { // credentials: "same-origin", @@ -66,7 +66,7 @@ async function sendData() { // headers: { "Content-Type": "application/json" }, // body: dataToSend //}) -// .then(resp => { + // .then(resp => { // if (resp.status === 200) { // return resp.json() // } else { @@ -75,7 +75,6 @@ async function sendData() { // } // }) // .then(dataJson => { -// console.log(dataJson.get("a")); // dataReceived = JSON.parse(dataJson.getJSON); // }) // .catch(err => { @@ -84,7 +83,13 @@ async function sendData() { // }) //console.log(`Received: ${dataReceived}`) -fetch('https://draft.hgk.global/feedbk/') +fetch("/feedbk/", { + credentials: "same-origin", + mode: "same-origin", + method: "post", + headers: { "Content-Type": "application/json" }, + body: dataToSend +}) .then(response => response.json()) .then(json => console.log(json))