public async Task <DeviceEventLogEntry> PostDeviceEventLogEntryAsync(DeviceEventLogEntry logEntry) { Models.DeviceEventLogEntry e = null; try { HttpResponseMessage response = await client.PostAsJsonAsync( Constants.EVTLOGS_DIR, logEntry); response.EnsureSuccessStatusCode(); if (response.IsSuccessStatusCode) { e = await response.Content.ReadAsAsync <DeviceEventLogEntry>(); } } catch (HttpRequestException httprex) { return(new DeviceEventLogEntry { HttpRequestException = httprex }); } return(e); }
public DeviceEventLogEntry PostDeviceLongEntry(DeviceEventLogEntry logEntry) { return(PostDeviceEventLogEntryAsync(logEntry).Result); }