我正在请求从 geonames 获取天气信息和 openweather但问题是我还使用 GeoLocation Api 获取用户位置,这需要 https。现在,当我发出 http 请求时,它说
Mixed Content: The page at 'https://xyz/dashboard' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.geonames.org/findNearByWeatherJSON?lat=33.6154812&lng=73.0105414&username=xyz'. This request has been blocked; the content must be served over HTTPS.
当我在 https
上时发出此 http
请求的解决方案是什么。
最佳答案
您应该考虑执行请求服务器端并通过您的安全服务器将数据发送到客户端。
关于http - 如何从运行 ssl 的网站向外部 webapi 发出非 ssl 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37495983/