Code: Select all
curl -X POST -H "Content-Type: application/json" http://api.openweathermap.org/data/3.0/measurements?appid=1234abc -d '[{"station_id":"121314a","dt":1606139843,"temperature":8.500000}]'
Code: Select all
domoticz.openURL({
url = 'http://api.openweathermap.org/data/3.0/measurements?appid=1234abc',
method = 'POST',
callback = 'owm_callback',
postData = {station_id = "121314a", dt = 1606139843, temperature =8.500000}
)}
2022-05-15 23:31:44.328 Status: dzVents: Debug: OWM: {"code":400001,"message":"unmarshal type error: expected=[]types.MeasurementRequest, got=object, offset=1"}
I could use curl with os.execute but I prefer to use openURL. Anyway to get the square brackets surrounding the postData?