==================================================== JSON Util ==================================================== **Create Util** .. code-block:: lua json_util = util('json') .. contents:: 目次 :local: :depth: 2 Method ==================================================== ---------------------------------------------------- table_to_json ---------------------------------------------------- .. code-block:: lua response = json_util:table_to_json(request) if response.isError then -- エラー処理 -- print(response.statusCode) print(response.errorMessage) else -- 正常処理 -- print(response.result) end LuaテーブルをJSONフォーマットのテキストに変換します。 Request ---------------------------------------------------- [table] Luaテーブル Response ---------------------------------------------------- [string] JSONテキスト ---------------------------------------------------- json_to_table ---------------------------------------------------- .. code-block:: lua response = json_util:json_to_table(request) if response.isError then -- エラー処理 -- print(response.statusCode) print(response.errorMessage) else -- 正常処理 -- print(response.result) end JSONフォーマットのテキストをLuaテーブルに変換します。 Request ---------------------------------------------------- [string] JSONテキスト Response ---------------------------------------------------- [table] Luaテーブル