I'm using urequests to send data to Adafruit.io,
Here is my function :
Code: Select all
def postAdafruit(temp):
url = "https://io.adafruit.com/api/feeds/ThermometreInvercargill/data.json"
headers = {
'X-AIO-Key':'myapikeytopsecret',
'Content-Type': 'application/json'
}
payload='{"value": %s }' % str(temp)
resp= urequests.post(url, data=payload, headers=headers)
print(resp.text)
print("Adafruit OK!")
but I got the error:
Code: Select all
NotImplementedError: Redirects not yet supported
While the data (basically temperature) is well sent to Adafruit feed.
Do you know a way to discard this error to allow my script to go on ?
Thanks in advance.