Get JSON info from one website & add to collection on my web

Hi, each time a certain page is visited on my website, I wanted my website to get all of the information from http://165.227.8.161:8080/radius25/Consumer/AvailableMerchants4Web/?q="categoryKey":%20null,"country":%20"USA","distance":%205,"location":%20"75024","name":%20"" in JSON format and add it to a database, will automatically display on my website when the page is ready.

Below is the the code I used in postman, which allowed me to see the JSON from a GET request.
How do I receive the request in the wix backend, and add it to the collection?
Thanks.

var data = null;

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

xhr.addEventListener(“readystatechange”, function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});

xhr.open(“GET”, “http://165.227.8.161:8080/radius25/Consumer/AvailableMerchants4Web/?q=“categoryKey”:%20null,“country”:%20"USA",“distance”:%205,“location”:%20"75024",“name”:%20""”);
xhr.setRequestHeader(“Cache-Control”, “no-cache”);
xhr.setRequestHeader(“Postman-Token”, “9627414c-f0d6-4743-a6b5-02a538f52810”);

xhr.send(data);

I tried the following code on the front end on a page, but when I try running it, it says TypeError: Failed to Fetch

export function vectorImage1_click(event, $w) {

fetch("http://165.227.8.161:8080/radius25/Consumer/AvailableMerchants4Web/?q=%22categoryKey%22:%20null,%22country%22:%20%22USA%22,%22distance%22:%205,%22location%22:%20%2275024%22,%22name%22:%20%22%22", { 
        method: "get", 
        headers: { 

‘Content-Type’: ‘application/json’,
}
})
.then((httpResponse) => {
let url = httpResponse.url;
let statusCode = httpResponse.status;
let statusText = httpResponse.statusText;
let headers = httpResponse.headers;
let bodyUsed = httpResponse.bodyUsed;
if (httpResponse.ok) {
return httpResponse.json();
} else {
return Promise.reject(“Fetch did not succeed”);
}
})
.then((json) => {
console.log(json.name);
})
. catch ((err) => {
console.log(err);
});
}

Hi Aashay,

First of all, refer to the fetch() API for details. You will need to use an https URL. Pay attention to the following detail from the documentation:
You cannot request HTTP content if your site is an HTTPS site. To fix this issues you can either use the HTTPS protocol to fetch the requested resources or you can turn off SSL on your site .

I have no idea if your fetch configuration is correct. You will have to contact the web service provider to determine the proper fetch details.

Yisrael