I'm at a loss here - I've tried everything, and I just can't seem to figure out what the issue is. I'm attempting to make a 'POST' request to my teacher's server for a homework assignment, but for some reason it's not working. I've been stuck on this problem for over 2 hours now.
Below is the code I've written:
const xhr = new XMLHttpRequest();
const url = 'https://3uc5taw99i.execute-api.us-east-1.amazonaws.com/latest/attendees';
let attendee = JSON.stringify({firstName: 'Nikola', lastName: 'Nikola', email: 'Nikola', dateBirth: '13.12.1869'});
xhr.responseType = 'json';
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
console.log(xhr.response);
}
}
xhr.open('POST', url);
xhr.send(attendee);