https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.pdf
"""
+import json
import logging
from typing import Any, Dict, List, Optional
return None
if r.status_code != 200:
+ logger.debug(r.text)
logger.error('Unexpected response code %d, wanted 200. Fail.', r.status_code)
return None
- # print(json.dumps(r.json(), indent=4, sort_keys=True))
+ logger.debug('Response: %s', json.dumps(r.json(), indent=4, sort_keys=True))
return r.json()
except Exception as e:
logger.exception(e)
return None
+
if r.status_code != 200:
- print(r.text)
+ logger.debug(r.text)
logger.error('Unexpected response code %d, wanted 200. Fail.', r.status_code)
return None
+ logger.debug('Response: %s', r.text)
for line in r.text.split('\n'):
line = line.strip()
if len(line) > 0: