Hey guys I have the following code working which is sending a GET Request and receiving JSON Response.
Now I can basically go
GetWeatherByLocation(53.3, -6.28);
and the method returns
{"status":"OK","url":"http://www.link.com/areas/rathfarnham-11","name":"Rathfarnham"}
I was now wondering how can I retrieve the values for
- URL
- Name
from the string returned
THanks a lot
Im using ASP.NET 2 this is my calling code
public static string GetWeatherByLocation(double lat, double lng)
{
string formattedUri = String.Format(CultureInfo.InvariantCulture,
FindNearbyWeatherUrl, lat, lng);
HttpWebRequest webRequest = GetWebRequest(formattedUri);
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
string jsonResponse = string.Empty;
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
jsonResponse = sr.ReadToEnd();
}
return jsonResponse;
}