I just have a quick question. I have this JSON string in C#, and I'm wondering if it's correct.
var json_data1 = "{\"serverName\": \"" + ServerStats.serverName +
"\",\"cpuLoad\":\" " + ServerStats.cpuLoad +
"\",\"memLoad\":\" " + ServerStats.memoryLoad +
"\",\"drive0\":\" " + ServerStats.drive0 +
"\",\"drive1\":\" " + ServerStats.drive1 +
"\",\"drive2\":\" " + ServerStats.drive2 +
"\",\"drive3\":\" " + ServerStats.drive3 +
"\",\"drive4\":\" " + ServerStats.drive4 +
"\",\"service0\":\" " + ServerStats.testService0 +
"\",\"service1\":\" " + ServerStats.testService1 +
"\",\"service2\":\" " + ServerStats.testService2 +
"\",\"lastBoot\":\" " + ServerStats.lastBoot + "\"}";
Is there anything wrong syntax wise with my JSON string?
The reason I'm asking is that the JSON string posts to my API if I take out ",lastBoot:" + ServerStats.lastBoot
, but when that line is added into the JSON string, it does not work. Any ideas? Thank you for your help.
EDIT: I updated my JSON string above, will this one work?