I've been attempting to send a JSON payload via a JavaScript script, but my webhooks don't seem to recognize the payload no matter what I try.
Here is the code that I compiled from various online resources:
let xhr = new XMLHttpRequest();
xhr.open("POST","https://webhook.site/4530328b-fc68-404a-9427-3f2ccd853066/",true);
xhr.setRequestHeader("Content-Type", "application/json");
let data = JSON.stringify({'eventType' : 'test'});
xhr.send(data);
Although I'm not well-versed in JavaScript development, it appears to me that this code should work. However, whenever I run this snippet, the POST URL doesn't provide any response back :/
Any thoughts on why this might be happening? :)
Thank you for your attention!