public void GetDeviceTypeCustomerNull() { LogResult.Report(Log, "log_ForInfo", "GetDeviceTypeDetails: Starts for Customer" + CustomerUID); GetToken(false); CustomHeaders.Add(CustomerUid, ""); var ResponseJSON = RestClientUtil.DoInvalidHttpRequest(AssetServiceConfig.GetDeviceType, HeaderSettings.GetMethod, AccessToken, HeaderSettings.JsonMediaType, null, HttpStatusCode.BadRequest, HeaderSettings.BearerType, HeaderSettings.JsonMediaType, CustomHeaders); deviceTypeResponse = JsonConvert.DeserializeObject <DeviceTypeResponse>(ResponseJSON); LogResult.Report(Log, "log_ForInfo", "GetDeviceTypeDetails: Ends for Customer" + CustomerUID); }
public void GetDeviceTypeDetails() { try { LogResult.Report(Log, "log_ForInfo", "GetDeviceTypeDetails: Starts for Customer" + CustomerUID); if (CustomHeaders == null) { CustomHeaders.Add(CustomerUid, CustomerUID.ToString()); } GetToken(false); var ResponseJSON = RestClientUtil.DoHttpRequest(AssetServiceConfig.GetDeviceType, HeaderSettings.GetMethod, AccessToken, HeaderSettings.JsonMediaType, null, HttpStatusCode.OK, HeaderSettings.BearerType, HeaderSettings.JsonMediaType, CustomHeaders); deviceTypeResponse = JsonConvert.DeserializeObject <DeviceTypeResponse>(ResponseJSON); LogResult.Report(Log, "log_ForInfo", "GetDeviceTypeDetails: Ends for Customer" + CustomerUID); } catch (Exception e) { LogResult.Report(Log, "log_ForError", "Exception Occured while getting device type details" + "CustomerUID-" + CustomerUID); throw new Exception("Exception Occured while getting device type details" + "CustomerUID - " + CustomerUID + "DeviceUID - "); } }