public static bool ReadECUData(ref ECUData ECUVars, String url) { ECUData tempecu; bool retval = false; url = "http://" + url + "/ecu"; HttpClient client = new HttpClient(); client.BaseAddress = new Uri(url); try { HttpResponseMessage response = client.GetAsync(url).Result; if (response.IsSuccessStatusCode) { var result = response.Content.ReadAsStringAsync().Result; if (result == null) { return(false); } if (result == "") { return(false); } tempecu = JsonConvert.DeserializeObject <ECUData>(result); //Now we have name value pairs of ECU variables. Need to calculate a few remaining ones // ECUData.CalcECUItems(ref tempecu); Obsolete ObjectCopier.CopyShallow <ECUData>(tempecu, ECUVars); //Now ensure we've copied the Relay Status retval = true; } } catch (Exception e) { Console.WriteLine(e.Message); } return(retval); }