Add ReCClient class and update project dependencies
Added `ReCClient` class to handle HTTP requests with JSON serialization/deserialization support. Updated `ReC.Client.csproj` to include `System.Net.Http` (v4.3.4) and `System.Text.Json` (v9.0.11) as package references. Introduced conditional `using` directives for `NETFRAMEWORK` compatibility.
This commit is contained in:
parent
b71ea7d346
commit
1fc4570210
@ -8,4 +8,9 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||||
|
<PackageReference Include="System.Text.Json" Version="9.0.11" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
22
src/ReC.Client/ReCClient.cs
Normal file
22
src/ReC.Client/ReCClient.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace ReC.Client
|
||||||
|
{
|
||||||
|
public class ReCClient
|
||||||
|
{
|
||||||
|
private readonly HttpClient _http;
|
||||||
|
private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions() { PropertyNameCaseInsensitive = true };
|
||||||
|
|
||||||
|
public ReCClient(HttpClient http)
|
||||||
|
{
|
||||||
|
_http = http ?? throw new ArgumentNullException(nameof(http));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user