Experiment

const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener(‘readystatechange’, function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});

xhr.open(‘GET’, ‘https://numbersapi.p.rapidapi.com/6/21/date?fragment=true&json=true’);
xhr.setRequestHeader(‘X-RapidAPI-Key’, ‘b1a58149f8mshc1c6b78f675715bp19778ejsn87bb90561743’);
xhr.setRequestHeader(‘X-RapidAPI-Host’, ‘numbersapi.p.rapidapi.com’);

xhr.send(data);