Use Newtonsoft.Json
Create your custom class:
public class MyResponse {
public string id { get; set; }
public string name { get; set; }
public string email { get; set; }
public string gender { get; set; }
public friend friends { get; set; }
public class friend{
public List<data> data {get;set;}
public class data {
string id {get;set;}
string name {get;set;}
}
}
}
Now you can deserialize your json like:
MyResponse response = Newtonsoft.Json.JsonConvert.DeserializeObject<MyResponse>("You json string here");
Now this response object will be filled by your return json string. If you don't have Newtonsoft.Json dll, you can download it from the following link:
https://www.nuget.org/packages/newtonsoft.json/
if you dont want to use custom class, you can use dynamic keyword like:
dynamic stuff = JsonConvert.DeserializeObject("Your json string here");
string name = stuff.name;
string email= stuff.email;
And so on.