Lazarus
Free Pascal => General => Topic started by: Frogfather on July 22, 2022, 09:29:26 am
-
Hello,
I'm looking for a way to convert a TJSONObject to a string, much the same way as JSON.stringify does it in JS.
I'd thought that TJSONStreamer.ObjectToJSONString() would do the trick, but this returns '{}' despite the fact that the JSON object being passed in definitely has properties.
If the above is the correct approach could someone advise what I'm doing wrong? Otherwise is there a way to do this without rolling my own solution?
Thanks in advance
John C
-
Obj.AsJSON?
-
Sometimes the answer is staring you in the face :-[
Many thanks!
-
You can look at FormatJSON function also, it has some handy format options.