From 776813d05dadbdd0fd2ad3cef51810c1fa4c91ff Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 2 Mar 2026 13:40:43 +0100 Subject: [PATCH] Simplify StringContent assignment in HTTP request Refactored code to assign StringContent directly to httpReq.Content without a using block. Disposal of StringContent is now handled by HttpRequestMessage, improving code clarity and resource management. --- .../RecActions/Commands/InvokeRecActionViewCommand.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs index 4928018..6f35335 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionViewCommand.cs @@ -43,10 +43,7 @@ public class InvokeRecActionViewCommandHandler( .ToHttpRequestMessage(action.EndpointUri); if (action.Body is not null) - { - using var reqBody = new StringContent(action.Body); - httpReq.Content = reqBody; - } + httpReq.Content = new StringContent(action.Body); if (action.Headers is not null) foreach (var header in action.Headers)