Can anybody help to do a REST call.
MY CODE
ERROR received is in attached image.
const header = new Headers();
header.append("Access-Control-Allow-Origin", "*")
header.append("cache-control","no-cache")
fetch("https://api.coinex.com/v1/market/list",{
headers : header,
rejectUnauthorized: false
}).then(res =>{
return res.json()
.then(r =>{
console.log(r)
})
})
Top comments (2)
This is happening because your browser is not allowing the response that server is sending. The problem might be headers are not added correctly to the request headers. Can you Share the screenshot of network tab? and see if request headers are properly set or not.
Never Mind, I solved it with the help of following URL - stackoverflow.com/questions/438716...
Use the Proxy URL