Edited : this solution don't works (Solution)
I have an API gave me String response as shown in image below
Now I want to creat request in javascript to save this response but it gave me empty string :
fetch("https://xxxxxxxxxxxxxxxxx", {
"method": "GET",
"headers": {
"Content-Type": "application/json",
"Access-Control-Allow-Origin" : "*",
"Access-Control-Allow-Credentials" : true ,
"authority": "clientportal.webresults-nt.com",
"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"",
"accept": "q=0.8;application/json;q=0.9",
"content-type": "application/json; charset=utf-8",
"user-token": "",
"sec-ch-ua-mobile": "?0",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36",
"sec-ch-ua-platform": "\"Windows\"",
"origin": "https://xxxxxxxxxxxxxxxxx",
"sec-fetch-site": "cross-site",
"sec-fetch-dest": "empty",
"referer": "https://xxxxxxxxxxxxxxx/",
"accept-language": "ar,en-US;q=0.9,en;q=0.8,fa;q=0.7,fr;q=0.6,ms;q=0.5,tr;q=0.4"
}
})
.then(response => response.text())
.then((response) => {
console.log(response)
})
.catch(err => console.log(err))