make httpclient public
This commit is contained in:
@@ -5,9 +5,10 @@ namespace Pilz.Net.Api;
|
|||||||
|
|
||||||
public class ApiClient(string apiUrl) : IApiClient
|
public class ApiClient(string apiUrl) : IApiClient
|
||||||
{
|
{
|
||||||
protected readonly HttpClient httpClient = new();
|
|
||||||
protected readonly List<object> clients = [];
|
protected readonly List<object> clients = [];
|
||||||
|
|
||||||
|
public HttpClient HttpClient { get; set; } = new();
|
||||||
|
|
||||||
public virtual string ApiUrl { get; } = apiUrl;
|
public virtual string ApiUrl { get; } = apiUrl;
|
||||||
|
|
||||||
public string? AuthKey { get; set; }
|
public string? AuthKey { get; set; }
|
||||||
@@ -84,7 +85,7 @@ public class ApiClient(string apiUrl) : IApiClient
|
|||||||
Content = content
|
Content = content
|
||||||
};
|
};
|
||||||
|
|
||||||
return await httpClient.SendAsync(httpmsg);
|
return await HttpClient.SendAsync(httpmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual string BuildParameters(ApiParameterCollection? @params)
|
protected virtual string BuildParameters(ApiParameterCollection? @params)
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using Castle.Core.Logging;
|
using Castle.Core.Logging;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Pilz.Extensions.Reflection;
|
using Pilz.Extensions.Reflection;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Encodings.Web;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Xml;
|
|
||||||
using static Pilz.Net.Api.IApiServer;
|
using static Pilz.Net.Api.IApiServer;
|
||||||
|
|
||||||
namespace Pilz.Net.Api;
|
namespace Pilz.Net.Api;
|
||||||
|
|||||||
Reference in New Issue
Block a user