如何从ssl运行的网站向外部webapi发出非ssl请求

时间:2016-05-28 06:31:22

标签: http ssl https weather-api

我正在请求从geonamesopenweather获取天气信息,但问题是我还使用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.

我在http时提出此https请求的解决方案是什么。

1 个答案:

答案 0 :(得分:1)

您应该考虑执行请求服务器端,并通过安全服务器将数据发送到客户端。