#1 2015-03-03 14:20:45

automacaosamos
Member
Registered: 2015-02-19
Posts: 20

Remove {"result":[]} from JSON

my app return :

{"result":[{"success":true,"rows":[{"CODIGO":"00001","NOME":"JOSE"}],"total":2}]}

I would like the result to be;

{"success":true,"rows":[{"CODIGO":"00001","NOME":"JOSE"}],"total":2}

I published the method:

Result := ObjectToJson(ExtjsObject, []);

it is possible to remove?

sorry I'm starting at mormot

cido

Offline

#2 2015-03-03 14:22:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Remove {"result":[]} from JSON

You can use the TServiceCustomAnswer record type as the result of an interface function, so that you can return directly whatever content you need, including raw JSON.

See http://synopse.info/files/html/Synopse% … #TITLE_390

Offline

Board footer

Powered by FluxBB