i have a simple json post request. i have nested json object to send , the key "text" contains 2 subkeys like this : "text" : {"nom":"user1","browser":"chrome"}
the 2 subkeys ( "name","browser") there values are javascript params, i want to replace them in the json object to send . i tried this!
var var1=session.get("userConnected");
var var2=checkBrowser();
var values =
{ type: "text"
, text:"{\"name\":\"+var1+\",\"browser\":" +var2+"}"
};
Please how do i replace javascript params inside json object? and thanks alot