【发布时间】:2016-01-10 13:42:23
【问题描述】:
我正在尝试以 JSON 格式获取伦敦的天气数据,但我收到了 HTTPError: HTTP Error 401: Unauthorized。如何让 API 正常工作?
import urllib2
url = "http://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=10&mode=json&units=metric"
response = urllib2.urlopen(url).read()
【问题讨论】:
标签: python weather-api openweathermap