I am baffled by one particular problem. I am trying to set a cookie using the fetch api but I am unable to do so.
static deleteorder = (domain = "http://localhost:8080/pc", order) => {
let cooks = "JSESSIONID=AFAFWEEVV2323GG";
fetch(deleteorder, {
method: `GET`,
credentials: 'same-origin',
headers: {
"Content-type": `application/x-www-form-urlencoded`,
},
})
.then(res => {
console.log(res.status);
})
.catch(error => {
console.log(error);
});
};
}
When The function runs and 200
is returned but the data remains the same meaning the order remains. Can one of you shed some light? I am in the beginner phase of learning the fetch api so any feedback would be greatly appreciated.