cookie support in dzVents
Posted: Sunday 28 October 2018 10:50
Hi,
i created a dzvents script which sends a Notification if i have to put my garbage container at the road by accessing the API of the company which collects the garbage. This API uses cookies. And since domoticz.openURL does not support cookies i had to use curl. Unfortunately this does not work as an asynchronous mechanism, so sometimes when the internet is slow my domoticz 'hangs' on completing this request.
my suggestion would therefore be to extend the domoticz.openURL function with cookiesupport, by adding a 'cookie' field to the definitiion, e.g.
domoticz.openURL({
url = 'http://domain/path/to/something',
method = 'POST',
callback = 'mycallbackstring',
cookie = 'cookiedata'
postData = {
paramA = 'something',
paramB = 'something else'
}
})
so i can change this curl statement to domoticz.openURL command
Would this be possible? If not? Is there another way to make this an asynchronous call in dzvents?
i created a dzvents script which sends a Notification if i have to put my garbage container at the road by accessing the API of the company which collects the garbage. This API uses cookies. And since domoticz.openURL does not support cookies i had to use curl. Unfortunately this does not work as an asynchronous mechanism, so sometimes when the internet is slow my domoticz 'hangs' on completing this request.
my suggestion would therefore be to extend the domoticz.openURL function with cookiesupport, by adding a 'cookie' field to the definitiion, e.g.
domoticz.openURL({
url = 'http://domain/path/to/something',
method = 'POST',
callback = 'mycallbackstring',
cookie = 'cookiedata'
postData = {
paramA = 'something',
paramB = 'something else'
}
})
so i can change this curl statement to domoticz.openURL command
Code: Select all
curl --cookie "RovaLc_inwoners={\"Id\":160266,\"ZipCode\":\"8013TP\",\"HouseNumber\":\"10\",\"HouseAddition\":null,\"Municipality\":\"Zwolle\",\"Province\":null,\"Firstname\":null,\"Lastname\":null,\"UserAgent\":\"\",\"School\":null,\"Street\":null,\"Country\":null,\"Portal\":null,\"AreaLevel\":5,\"City\":\"Zwolle\",\"Ip\":null}" https://www.rova.nl/api/TrashCalendar/GetCalendarItems?portal=inwoners