Is it some how possible to send a get request from a https website to a http address with fetch API.
fetch('http://103.82.8.194/Data/', { mode: 'no-cors' })
.then(response => response.json())
.then(data =>
console.log(data)
);
Like is it some how possible send this request from ?
Is it some how possible to send a get request from a https website to a http address with fetch API.
fetch('http://103.82.8.194/Data/', { mode: 'no-cors' })
.then(response => response.json())
.then(data =>
console.log(data)
);
Like is it some how possible send this request from https://rionislam.github.io ?
Share Improve this question edited Jul 11, 2023 at 18:37 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked May 27, 2022 at 7:34 Rion IslamRion Islam 741 gold badge2 silver badges6 bronze badges 1- Why do you want it? It is not possible with javascript alone in a browser that others usually use. It seems that you need to create a proxy server that receives http requests. It is best to include the data on your website instead of requesting it. – lowfront Commented May 27, 2022 at 8:48
1 Answer
Reset to default 4It's not possible to request http address from a https website directly because of the Mixed Content Security Policy, it'll be blocked by the browser.
You can use a https proxy to do so, something like: https://some-proxy-url?url=http://103.82.8.194/Data/.
or just upgrade http server to https