Posted 12 February 2014 - 02:30 PM
Repost from the JSON-Api Thread. I would like to read a JSON File which has more layers :
Nice Api you have there i get it to work with easy json like:with{ "firstline": "John", "secline": "Doe", "txtcol": "colors.white", "backcol": "colors.blue" }
but with complicated json like:os.loadAPI("json") str = http.get("http://www.someserver.com/").readAll() obj = json.decode(str) print(obj.firstline)
{ "monitornorth": [ { "firstline": "John", "secline": "Doe", "txtcol": "colors.white", "backcol": "colors.blue" } ] }
obj.monitornorth.firstline is emptyos.loadAPI("json") str = http.get("http://www.someserver.com/").readAll() obj = json.decode(str) print(obj.monitornorth.firstline)
What do i do wrong?