To generate classes you can use JSON2CSHARP and to desrialize your JSON use Json.NET.
Model:
public class Response
{
public string MeterID { get; set; }
public string KWHMainActual { get; set; }
public string KWActual { get; set; }
public string KWHDGActual { get; set; }
public string MeterOnOff { get; set; }
public string MeterDefective { get; set; }
public string RecordDateTime { get; set; }
}
public class RootObject
{
public string type { get; set; }
public string error { get; set; }
public string warning { get; set; }
public string info { get; set; }
public string response_code { get; set; }
public List<Response> response { get; set; }
}
and deserialize method
JsonConvert.DeserializeObject<RootObject>("jsonString");
Edit:
Using WebRequest
You can get your json from uri, try this method
public async Task<string> GetFromUri(string uri)
{
var request = (HttpWebRequest) WebRequest.Create(new Uri(uri));
request.ContentType = "application/json";
request.Method = "GET";
// Send the request to the server and wait for the response:
using (var response = await request.GetResponseAsync())
{
// Get a stream representation of the HTTP web response:
using (var stream = response.GetResponseStream())
{
var reader = new StreamReader(stream);
var message = JsonConvert.DeserializeObject<string>(reader.ReadToEnd());
return message;
}
}
}
call method
var jsonString = await GetFromUri("uri");