Difference between revisions of "Json"
From GiderosMobile
(added template) |
|||
Line 29: | Line 29: | ||
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
|} | |} | ||
+ | |||
+ | {{Json}} |
Revision as of 13:45, 6 December 2019
Supported platforms:
Available since: Gideros 2013.09
Description
Provides Lua table serialization and deserialization to and from string in json format
Examples
Get user's geo:
require('json')
local loader = UrlLoader.new("http://ip-api.com/json")
loader:addEventListener(Event.COMPLETE, function(event)
local receivedTable=json.decode(event.data)
print(receivedTable.countryCode)
print(receivedTable.timezone)
end)
Methodsjson.decode Returns Lua table from provided json encoded string |
EventsConstants |