I am trying to display data collected from RestSharp. Just for example i have the following code but don't know how to display the data as it currently is.
private void readJSON()
{
string url = "http://www.jsonurl.com";
var restClient = new RestClient(url);
var request = new RestRequest(Method.GET);
//82.147.22.3
//What we are requesting:value
request.AddParameter("apikey", "xxxxxtheapikeygoesherexxxxx");
restClient.ExecuteAsync<Entry>(request, response =>
{
//What to do with the JSON?
});
}
I know i need to place the JSON between the ExecuteAsync<>() but i want to be able to take the data and for example place it into a listbox. Below is an example of the result given back to me from JSONtoSharp.com. code:
public class Change
{
public string direction { get; set; }
public int amount { get; set; }
public int actual { get; set; }
}
public class itementry
{
public int position { get; set; }
public int prePosition { get; set; }
public int Weeks { get; set; }
public string ar { get; set; }
public string ti { get; set; }
public Change ch { get; set; }
}
public class RootObject
{
public int charDate { get; set; }
public int retrieved { get; set; }
public List<Entry> entries { get; set; }
}
I am sure the answer is simple as glass and I just need help as i am completely lost in this one.. cant find any good documentation to help me out!
Note: This is for C# on Windows Phone 7 using RestSharp and Newtonsoft