You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
req.add_header('Referer',YOUR SITE)
solve the problem but we have to set it in def init(self, base_url=None)
def request(self, url):
"""
Send a http request to the given *url*, try to decode
the reply assuming it's JSON in UTF-8, and return the result
:returns: Decoded result, or None in case of an error
:rtype: mixed
"""
self.logger.debug('url:\n' + url)
try:
req = Request(url)
req.add_header('Referer', 'http://rmap.cc')
response = urlopen(req)
return json.loads(response.read().decode('utf-8'))
except URLError:
self.logger.info('Server connection problem')
except Exception:
self.logger.info('Server format problem')
The text was updated successfully, but these errors were encountered:
pat1
pushed a commit
to r-map/nominatim
that referenced
this issue
Apr 13, 2016
According to:
http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy#Requirements
we need to set HTTP Referer or we get urllib2.HTTPError: HTTP Error 403: Forbidden
req.add_header('Referer',YOUR SITE)
solve the problem but we have to set it in def init(self, base_url=None)
The text was updated successfully, but these errors were encountered: