admin管理员组文章数量:1398828
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
本文标签: javascriptFetch request to http address from a https websiteStack Overflow
版权声明:本文标题:javascript - Fetch request to http address from a https website - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744092533a2589687.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论