I'm working on a Xamarin.Forms project and in the project I have to GET data from a Json URL, I'm using this code :
string URL = "https://example.com/.json"; var httprequest = (HttpWebRequest)WebRequest.Create(URL); var response = (HttpWebResponse)httprequest.GetResponse(); var stream = new StreamReader(response.GetResponseStream()).ReadToEnd(); var firebasevariable = JObject.Parse(stream); string dist = firebasevariable["distance"].ToObject<string>(); but the "dist" value keeps returning NULL ! I imported the System.Net.Http and the Newtonsoft.Json libraries I also get this warning but I don't know if its the cuz why I get the NULL , I tried my link using the postman and it returns the data perfectly
There was a conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"
streamcontains valid JSON?firebasevariable.Value<string>("distance");if that doesn't work, you need to inspectfirebasevariablewith the debugger