Hi!
I'm trying to Execute javascript in Google Chrome. To be more precise: I want to send HTTP request with fetch to a webhook and save returned data to a KM variable.
The thing is: I got an empty results. Code snippet:
(async function() {
const response = await fetch("[webhook_url]", {
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
body: JSON.stringify({
"url": "test_data"
})
});
const data = await response.json()
document.kmvar.omfg = data.message;
})();
What am I missing?