Ready to test v2.43.0
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user