/// <summary> /// Post Backtrace JObject to server /// </summary> /// <param name="submissionUrl">Submission URL</param> /// <param name="jObject">Backtrace JObject</param> /// <param name="onComplete">On complete callback</param> /// <returns>Async operation</returns> public void Post(string submissionUrl, BacktraceJObject jObject, Action <long, bool, string> onComplete) { UnityWebRequest request = new UnityWebRequest(submissionUrl, "POST") { timeout = RequestTimeout }; request.IgnoreSsl(IgnoreSslValidation); var bytes = Encoding.UTF8.GetBytes(jObject.ToJson()); request.uploadHandler = (UploadHandler) new UploadHandlerRaw(bytes); request.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer(); request.SetJsonContentType(); var asyncOperation = request.SendWebRequest(); asyncOperation.completed += (AsyncOperation operation) => { var statusCode = request.responseCode; var response = request.downloadHandler.text; var networkError = request.ReceivedNetworkError(); request.Dispose(); if (onComplete != null) { onComplete.Invoke(statusCode, networkError, response); } }; }