我正在请求从地理名称和开放天气中获取天气信息,但问题是我也使用 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
请求的解决方案是什么?
您应该考虑执行请求服务器端,并通过安全服务器将数据发送到客户端。