public void LogError(string message, string payload) { try { ErrorLogRequest request = new ErrorLogRequest(); request.ErrorLog.Message = message; request.ErrorLog.Payload = payload; HttpClient client = new HttpClient(); client.BaseAddress = new Uri(LAN_Address); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("EO-Header", User + " : " + Pwd); string jsonData = JsonConvert.SerializeObject(request); var content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpResponseMessage httpResponse = client.PostAsync("api/Login/LogError", content).Result; if (httpResponse.IsSuccessStatusCode) { } } catch (Exception ex) { //ironic } }
public void LogError(ErrorLogRequest request) { inventoryManager.LogError(request); }
public void LogError(ErrorLogRequest request) { persistence.LogError(request); }