This is just a test

// Create a new XMLHttpRequest object var xhr = new XMLHttpRequest(); // Define the API endpoint URL var apiUrl = ‘https://api.example.com/data’; // Configure the request xhr.open(‘GET’, apiUrl, true); // true for asynchronous request // Set up a callback function to handle the response xhr.onload = function() { // Check if the request was successful (status code 200) if (xhr.status >= 200 && xhr.status < 300) { // Parse the JSON response var responseData = JSON.parse(xhr.responseText); // Process the data here console.log(‘Data received:’, responseData); } else { // Handle errors if the request was not successful console.error(‘Request failed with status code:’, xhr.status); } }; // Set up a callback function to handle network errors xhr.onerror = function() { console.error(‘Network request failed’); }; // Send the request xhr.send();