public void UploadResult(CurrentProfile currentProfile) { var request = new RestRequest("api/benchmarks/upload", Method.POST); JsonSerializerSettings sets = new JsonSerializerSettings() { PreserveReferencesHandling = PreserveReferencesHandling.Objects }; String profileJson = JsonConvert.SerializeObject(currentProfile); /*if(!File.Exists(currentProfile.Name + ".json")) * File.Create(currentProfile.Name + ".json").Close(); * File.WriteAllText(currentProfile.Name + ".json", irr);*/ request.AddHeader("Content-Type", "multipart/form-data"); if (currentProfile.BenchmarkFiles != null) { foreach (String file in currentProfile.BenchmarkFiles) { request.AddFile("3dmark_upload", file); } } request.AddJsonBody(profileJson); var response = _restClient.Execute(request); if (response.StatusCode == HttpStatusCode.InternalServerError) { // TODO Handle error cases Trace.WriteLine("Error"); } else { dynamic responseContent = JObject.Parse(response.Content); var profile = new Profile(responseContent.profile); Trace.WriteLine(profile); var psi = new ProcessStartInfo { FileName = $"http://comparebench.com/benchmark/{profile.ID}", UseShellExecute = true }; Process.Start(psi); } }