Refactor HTTP handling in InvokeRecActionCommand

Updated `ReC.Application.csproj` to include `Microsoft.Extensions.Http` for improved HTTP client management. Refactored `InvokeRecActionCommandHandler` to use `IHttpClientFactory` for creating `HttpClient` instances, enhancing resource efficiency. Simplified HTTP method handling by replacing the switch statement with a dynamic `HttpMethod` and `HttpRequestMessage` approach. Removed redundant `using` directives and renamed `header` to `headers` for clarity. Removed `BadRequestException` for unsupported REST types, streamlining error handling.
This commit is contained in:
Developer 02
2025-11-26 21:35:53 +01:00
parent 0837bca6cb
commit 7c00060f74
2 changed files with 10 additions and 20 deletions

View File

@@ -13,6 +13,7 @@
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
<PackageReference Include="MediatR" Version="13.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.11" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.0" />
</ItemGroup>
<ItemGroup>