Skip to content

Commit

Permalink
Merge pull request mvexel#86 from donfaq/master
Browse files Browse the repository at this point in the history
Requests proxy support
  • Loading branch information
mvexel committed Apr 6, 2018
2 parents 04feb8b + 97374e6 commit 5ea4924
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions overpass/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class API(object):
_timeout = 25 # second
_endpoint = "https://overpass-api.de/api/interpreter"
_debug = False
_proxies = None

_QUERY_TEMPLATE = "[out:{out}];{query}out {verbosity};"
_GEOJSON_QUERY_TEMPLATE = "[out:json];{query}out {verbosity};"
Expand All @@ -25,6 +26,7 @@ def __init__(self, *args, **kwargs):
self.endpoint = kwargs.get("endpoint", self._endpoint)
self.timeout = kwargs.get("timeout", self._timeout)
self.debug = kwargs.get("debug", self._debug)
self.proxies = kwargs.get("proxies", self._proxies)
self._status = None

if self.debug:
Expand Down Expand Up @@ -133,6 +135,7 @@ def _get_from_overpass(self, query):
self.endpoint,
data=payload,
timeout=self.timeout,
proxies=self.proxies,
headers={'Accept-Charset': 'utf-8;q=0.7,*;q=0.7'}
)

Expand Down

0 comments on commit 5ea4924

Please sign in to comment.