diff --git a/overpass/api.py b/overpass/api.py index 861a88facb9..bf2f20be1f5 100644 --- a/overpass/api.py +++ b/overpass/api.py @@ -81,10 +81,13 @@ def get(self, for row in reader: result.append(row) return result - elif content_type == "text/xml" or content_type == "application/xml": + elif content_type in ("text/xml", "application/xml", "application/osm3s+xml"): return r.text + elif content_type == "application/json": + response = json.loads(r.text) - response = json.loads(r.text) + if not build: + return response # Check for valid answer from Overpass. # A valid answer contains an 'elements' key at the root level.