发出打开天气的 http 请求时出现未知错误 api
unknown error when making a http request to open weather api
我在我的 stckblitz 项目中进行了一次 http 调用
http://api.openweathermap.org/data/2.5/weather?q=' + data.city + '&appid=' + this.APIKey
但是总是报错
Http failure response for http://api.openweathermap.org/data/2.5/weather?q=london&appid=6492527f849e5034d485df6b5981d407: 0 Unknown Error
您应该使用 url 的 https
版本:
https://api.openweathermap.org/data/2.5/weather?q=' + data.city + '&appid=' + this.APIKey
我在我的 stckblitz 项目中进行了一次 http 调用
http://api.openweathermap.org/data/2.5/weather?q=' + data.city + '&appid=' + this.APIKey
但是总是报错
Http failure response for http://api.openweathermap.org/data/2.5/weather?q=london&appid=6492527f849e5034d485df6b5981d407: 0 Unknown Error
您应该使用 url 的 https
版本:
https://api.openweathermap.org/data/2.5/weather?q=' + data.city + '&appid=' + this.APIKey