diff --git a/Pilz.Net/Api/ApiClient.cs b/Pilz.Net/Api/ApiClient.cs index bde21cb..9ee481e 100644 --- a/Pilz.Net/Api/ApiClient.cs +++ b/Pilz.Net/Api/ApiClient.cs @@ -5,9 +5,10 @@ namespace Pilz.Net.Api; public class ApiClient(string apiUrl) : IApiClient { - protected readonly HttpClient httpClient = new(); protected readonly List clients = []; + public HttpClient HttpClient { get; set; } = new(); + public virtual string ApiUrl { get; } = apiUrl; public string? AuthKey { get; set; } @@ -84,7 +85,7 @@ public class ApiClient(string apiUrl) : IApiClient Content = content }; - return await httpClient.SendAsync(httpmsg); + return await HttpClient.SendAsync(httpmsg); } protected virtual string BuildParameters(ApiParameterCollection? @params) diff --git a/Pilz.Net/Api/ApiServer.cs b/Pilz.Net/Api/ApiServer.cs index a946618..a6967b4 100644 --- a/Pilz.Net/Api/ApiServer.cs +++ b/Pilz.Net/Api/ApiServer.cs @@ -1,14 +1,10 @@ using Castle.Core.Logging; -using Newtonsoft.Json.Linq; using Pilz.Extensions.Reflection; using System.Diagnostics.CodeAnalysis; -using System.Linq; using System.Net; using System.Reflection; -using System.Text.Encodings.Web; using System.Text.RegularExpressions; using System.Web; -using System.Xml; using static Pilz.Net.Api.IApiServer; namespace Pilz.Net.Api;