Back to forum

How to respond with a valid json ?

Answered

Hi,
nice work with webdatarocks, thanks… but I have a question.
How can I send to the client a json result with the data types included ? How is it possible if the json object demonstrated here Json Data Types is not a a valid json object ?
The first object is not valid because it uses curly brackets instead of a string or a number right after of the first field’s name.
All the examples that I saw uses a static json with all fields configured and all values setted, but how can I put this to work in the real world if my server just can’t respond with an invalid json (with the invalid first configuration object) ?
Thanks in advance !
Regards,
Rafael

2 answers

Rafael July 28, 2020

My fault, it works like a charm… I just changed the first json config object to a valid format and everything works great. I created a method to serialize the “datatable” into a json with fields config inside. Thanks !!!!

WebDataRocks Team WebDataRocks July 31, 2020

Hello Rafael,
 
We are glad to hear you resolved the problem.
Please let us know in case of any other questions.
 
Regards,
WebDataRocks Team

Move up