Merge pull request from JaronStrypsteen/patch-1

update app.py
This commit is contained in:
Kyle Gabriel 2020-12-13 12:28:38 -05:00 committed by GitHub
commit 65a48a403c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,7 +121,8 @@ def get_new_data():
endpoint = "https://{app}.data.thethingsnetwork.org/api/v2/query/{dev}?last={time}".format(
app=application, dev=each_device, time="{}s".format(past_seconds))
logger.info(endpoint)
headers = {"Authorization": app_key}
key = 'key {}'.format(app_key)
headers = {'Authorization': key, 'Content-Type': 'application/json'}
response = requests.get(endpoint, headers=headers)
try:
for each_resp in response.json():