I'm making a friend list management tool for Steam using the web API. The following JSON is returned by the API:
{
"friendslist": {
"friends": [
{
"steamid": "12345678",
"relationship": "friend",
"friend_since": 1290444866
},
{
"steamid": "87654321",
"relationship": "friend",
"friend_since": 1421674782
},
{
"steamid": "5287931",
"relationship": "friend",
"friend_since": 1418428351
}
]
}
i try to parse it with this code:
public class Friendslist
{
public IDictionary<int, IDictionary<int, Friend>> friends { get; set; }
}
public class Friend
{
public uint steamid { get; set; }
public string relationship { get; set; }
public uint friend_since { get; set; }
}
string jsonString;
Friendslist jsonData;
WebRequest wr;
Stream objStream;
wr = WebRequest.Create(sURL);
objStream = wr.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream);
jsonString = objReader.ReadToEnd();
jsonData = JsonConvert.DeserializeObject<Friendslist>(jsonString);
but jsonData is always null when i check it with the debugger.