From 7c6b30aa7bc98dc9d1c077b822a09f3ecfae4e6d Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Tue, 17 Dec 2024 14:40:24 +0100 Subject: [PATCH] make httpclient public --- Pilz.Net/Api/ApiClient.cs | 5 +++-- Pilz.Net/Api/ApiServer.cs | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) 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;