OK. So, if you look at the following code, I made a web request in google api that returns the calendar information as a string, but I am having problems accessing the nested Json data. I searched a lot and, frankly, I was completely lost. here is the code where I make a web request and pass the Json data to a string:
WebRequest request = WebRequest.Create("http://www.google.com/calendar/feeds/ developer-calendar@google.com /public/full?alt=json"); request.Credentials = CredentialCache.DefaultCredentials; request.ContentType = "application/json"; WebResponse response = request.GetResponse(); Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader (dataStream); string responseFromServer = reader.ReadToEnd();
but as soon as I have a line containing Json Data, I can only access the version and encoding components with the following class:
public class calendarData { public string version { get; set; } public string encoding { get; set; } public string feed { get; set; } }
So, I think my question is the best way to access the json nested data in case of this request ... The URL provided in the web request above should work.
In addition, I work in the Xamarin studio, so I use Newtonsoft.Json to do my deserialization.
source share