I got the following code:
Code: Select all
sendData = {'Verb' : 'GET',
'URL' : '/api/s/default/stat/sta/',
'Headers' : {
'Cookie': self.cookie, \
'Host': Parameters["Address"]+":"+Parameters["Port"]
}
}
Domoticz.Log("RequestDetails sendData = "+str(sendData))
self.unifiConn.Send(sendData)
If I use liburl code:
Code: Select all
url = "https://"+Parameters["Address"]+":"+Parameters["Port"]+"/api/s/default/stat/sta/"
reqapi = urllib.request.Request(url,headers={'Cookie':self.cookie})
responseapi = urllib.request.urlopen(reqapi)
test = responseapi.read().decode('utf-8', 'ignore')
Domoticz.Log("API Response = " +test)
I dont understand why it's not working with the default connection methode for plugins.
Anyone an idea?