mvexel / overpass-api-python-wrapper

Python bindings for the OpenStreetMap Overpass API
Apache License 2.0
367 stars 90 forks source link

Adding proper user agent to HTTP requests #38

Closed mmd-osm closed 6 years ago

mmd-osm commented 8 years ago

Currently, overpass api python wrapper shows up in the log files as user agent: python-requests/2.2.1 .... Any chance to have this set to something more meaningful by default?

mmd-osm commented 7 years ago

Doesn't have to be super sophisticated, something like:

        payload = {"data": query}

        try:
            r = requests.post(
                self.endpoint,
                data=payload,
                timeout=self.timeout,
                headers={'Accept-Charset': 'utf-8;q=0.7,*;q=0.7',
                         'User-Agent' : 'Python wrapper for Overpass API' }
            )

would probably also be fine. Bonus points for including the current version number.