- if not deserialize_json then
- app.run_on_ui_thread new RestRunnableOnLoad(self, rep)
+ if deserialize_json then
+ # Deserialize
+ var deserializer = new JsonDeserializer(rep.value)
+ var res = deserializer.deserialize
+ if deserializer.errors.not_empty then
+ app.run_on_ui_thread new RestRunnableOnFail(self, deserializer.errors.first)
+ else
+ app.run_on_ui_thread new RestRunnableOnLoad(self, res, rep.code)
+ end
+ else
+ # Return text data
+ app.run_on_ui_thread new RestRunnableOnLoad(self, rep.value, rep.code)