mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-16 06:29:29 +00:00
Improve HttpClient with client constructor
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Extensions;
|
||||
using System.IO;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -56,6 +57,15 @@ public sealed class HttpClient<Tscope> : IHttpClient<Tscope>, IDisposable
|
||||
this.scope = typeof(Tscope);
|
||||
}
|
||||
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
public HttpClient(
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
HttpClient httpClient)
|
||||
{
|
||||
this.httpClient = httpClient.ThrowIfNull(nameof(httpClient));
|
||||
this.scope = typeof(Tscope);
|
||||
}
|
||||
|
||||
public void CancelPendingRequests()
|
||||
{
|
||||
this.LogInformation(string.Empty, "Canceling request");
|
||||
|
||||
Reference in New Issue
Block a user