Reputation: 340
I am creating a JSON object in code. But the JSON contains property params
, so when I try to create object like this:
using Newtonsoft.Json.Linq;
JObject json = JObject.FromObject(new
{
jsonrpc = "2.0",
method = "user.login",
params = new
{
user = "user",
password = "password"
},
id = 1
});
I get an error because VS thinks its params
the keyword. Is there way how to create object like this or somehow use params
without using params
?
Upvotes: 2
Views: 1725