I need to get following values of url from json
{
"method":"create",
"trace":"asdf/asdf/asdfasd",
"order": {
"ref":"asdfasdfasfasdfasd",
"url":"https://domain.com/gateway/process.html?o=asdasdasdasd9"
}
}
I am trying to get it using the following code:
var jsonData = (JObject)JsonConvert.DeserializeObject(str);
string url = jsonData["url"].Values<string>()
It is not working, I also tried JObject o = JObject.Parse(jsonData.ToString()); but I am not able to get it working either. (I get null exception for string url2 = jsonData["url"].Value<string>();)
Not sure what I am doing wrong
urlproperty is in a nested object?string url2 = jsonData["url"].Value<string>();while i have the result