I need to serialize a JSON string containing the following:
{
commandId;
id;
params:
{
userId;
password;
}``
}
The code I was given uses Qt and they declare a QJsonObject paramsObj and a QJsonObject cmdObj; they fill the field values and finally perform a cmdObj.insert("params", QJsonValue(paramsObj));
params is a keyword for VS and C# so I can't declare a class with that name, but this is the way the device will understand my JSON strings. I am fairly new to JSON and looked at the .Net class and the Newtonsoft library but can't find how to perform the insert of a JSON object inside another, assigning an arbitrary name to it. Can anyone shed some light? Thank you.