public bool SendSubmissionLog(SubmissionLog log) { string endpoint = buildEndpoint("submissions", log.SubmissionId, "logs"); var responseMessage = client.PostAsync(endpoint, log.AsJson()).Result; logger.Debug("{1} log for submission {0} send {2}", log.SubmissionId, log.Type.ToString(), responseMessage.StatusCode == HttpStatusCode.NoContent ? "successfully" : "failed"); if (responseMessage.StatusCode != HttpStatusCode.NoContent) { logger.Error("Sending submission log failed. Server error message: {0}", responseMessage.Content?.ReadAsStringAsync()?.Result); } return(responseMessage.StatusCode == HttpStatusCode.NoContent); }
public RequestMessage GetSendLogRequestMessage(SubmissionLog log) => new RequestMessage(buildEndpoint("submissions", log.SubmissionId, "logs"), log.AsJson());