Guys - i think i have worked it out ... Nest does a 307 redirect. I suspect the module is not sending the headers on the redirect request. This Python is working
import httplib
headers = {"Authorization": "Bearer c.{INSERT KEY}"}
conn = httplib.HTTPSConnection("developer-api.nest.com")
conn.request("GET", "/", "", headers)
response = conn.getresponse()
url2 = response.getheader("location")
url2 = url2[8:-1]
conn2 = httplib.HTTPSConnection(url2)
conn2.request("GET", "/", "", headers)
response2 = conn2.getresponse()
print response2.read()
conn.close()
conn2.close()
Any thoughts?
... View more