简体   繁体   English

如何从 github 中具有 HTTP 的 api 获取数据

[英]how to fetch data from a api that has HTTP in github

So I was trying to host my project of weather app in Github that fetches it's data from Accu weather API which I think uses a http and I am unable to fetch data and getting a error.所以我试图在 Github 中托管我的天气应用程序项目,它从 Accu weather API 中获取数据,我认为它使用了 http 并且我无法获取数据并且我无法获取错误。

Error message:错误信息:

forecast.js:21 Mixed Content: The page at 'https://alapottra-troj1n.github.io/Weather-App/' was loaded over HTTPS, but requested an insecure resource 'http://dataservice.accuweather.com/locations/v1/cities/search?apikey=xxx&q=Rangamati'. forecast.js:21 混合内容:“https://alapottra-troj1n.github.io/Weather-App/”页面在 HTTPS 上加载,但请求了不安全的资源“http://dataservice.accuweather.com/”位置/v1/cities/search?apikey=xxx&q=Rangamati'。 This request has been blocked;此请求已被阻止; the content must be served over HTTPS.内容必须通过 HTTPS 提供。 . .

Is there any way in Github that allows me to get data from a http website.. or are there any alternative free hosting website like Github that I can use Github 中是否有任何方法可以让我从 http 网站获取数据.. 或者是否有任何替代的免费托管网站,如我可以使用的 Github

just request the api with https, it is working!只需请求 api 和 https,它就可以工作!

https://dataservice.accuweather.com/locations/v1/cities/search?key=dsadasq=Rangamati https://dataservice.accuweather.com/locations/v1/cities/search?key=dsadasq=Rangamati

generally mixed content error is from the browser, it has nothing to do with github, it would affect any site where there is mixed content, you could edit you browser settings, but they are only for you https://experienceleague.adobe.com/docs/target/using/experiences/vec/troubleshoot-composer/mixed-content.html?lang=en#task_5448763B8DC941FD80F84041AEF0A14D通常混合内容错误来自浏览器,它与 github 无关,它会影响任何有混合内容的站点,您可以编辑浏览器设置,但它们仅适用于您https://experienceleague.adobe.com /docs/target/using/experiences/vec/troubleshoot-composer/mixed-content.html?lang=en#task_5448763B8DC941FD80F84041AEF0A14D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM