My axios request below is going out over https, but I'm encountering a specific error:
The page at 'http://websitename/folder1/folder2/api/atlas/home/coach' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://websitename/folder1/folder2/api/user?userid=15'. This request has been blocked; the content must be served over HTTPS.
Axios request snippet
loadUser() {
this.memberid = this.$route.params.userid;
if (axios == null) {
return;
}
axios
.get('https://websitename/folder1/folder2/api/atlas/api/user/', {
params: {
userid: this.loggedinuser
}
})
.then(res => {
this.user = res.data.user[0].name;
})
.catch(err => {
console.log(err);
});
}
While observing the network logs, I noticed that the request URL is sent over HTTPS but the Response header is showing http in the location field. How can I resolve this issue?