using Newtonsoft.Json; string returnJsonMessage = JsonConvert.SerializeObject(returnMessage);
BaseResponseDeviceMessage retVal = null; var req = HttpWebRequest.Create(@reqString); req.Method = requestMethod; req.ContentLength = 0; req.ContentType = @"application/json"; string jsonResp = ""; try { HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); using (StreamReader sr = new StreamReader(resp.GetResponseStream())) { jsonResp = sr.ReadToEnd(); } string t = JsonConvert.DeserializeObject<string>(jsonResp); retVal = JsonConvert.DeserializeObject<T>(t); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)