I’m working with the new jsondecode and I’m attempting to analyze a nested json similar to the weather example that was used on the early beta forum a few months ago. I’ve looked through the dev wiki but I can’t quite figure out a nested response.
The response I’m attempting to decode:
{
“response”: {
“version”: “0.1”,
“termsofService”: “http://www.wunderground.com/weather/api/d/terms.html”,
“features”: {
“astronomy”: 1
}
},
“moon_phase”: {
“percentIlluminated”: “81”,
“ageOfMoon”: “10”,
“current_time”: {
“hour”: “9”,
“minute”: “56”
},
“sunrise”: {
“hour”: “7”,
“minute”: “01”
},
“sunset”: {
“hour”: “16”,
“minute”: “56”
}
}
}
My code so far after the httprequest is:
local weather = http.jsondecode(response.body);
I want to access the “sunrise hour” but I’m not sure on the coding.
Thanks in advance