MET08RESIMAPCDE - v2.43.0 - Using EDA

Multiple Storage Paths and delete old way
This commit is contained in:
2022-06-07 11:10:00 -07:00
parent d6887992a0
commit 2e660ec384
81 changed files with 2028 additions and 1278 deletions

View File

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.Json;
@ -11,14 +10,14 @@ namespace Adaptation.Shared.Metrology;
public partial class WS
{
public static Tuple<string, Results> SendData(string url, object payload, int timeoutSeconds = 120)
public static (string, Results) SendData(string url, object payload, int timeoutSeconds = 120)
{
Results results = new();
string resultsJson = string.Empty;
try
{
string json = JsonSerializer.Serialize(payload, payload.GetType());
if (string.IsNullOrEmpty(url) || !url.Contains(':') || !url.Contains('.'))
if (string.IsNullOrEmpty(url) || !url.Contains(":") || !url.Contains("."))
throw new Exception("Invalid URL");
using (HttpClient httpClient = new())
{
@ -49,7 +48,7 @@ public partial class WS
results.Errors = new List<string>();
results.Errors.Add(stringBuilder.ToString());
}
return new Tuple<string, Results>(resultsJson, results);
return new(resultsJson, results);
}
// this method is a wrapper for attaching a file to either a header or data record