0
Hello! I’m trying to make a request through Javascript, but I’m not getting it.
I need to pick up the e-mail through a form and send this amount for the request, type application/x-www-form-urlencoded
On the Postman I put on the body the following way
key: email
value: ["meuemail@com"]
How do I take this form input value, turn it into this format I need and submit the request?
My JS code looks like this:
var btn = document.getElementById("Bsubmit");
var request = new XMLHttpRequest();
request.open('POST', '/request', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
btn.onclick = function() {
request.send();
}
Thanks, it worked! ^_^
– Bruno Camarda