From a66a70fab3d540c6d8327eeb3a24daf44dfd2ff2 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 27 Nov 2025 14:54:28 +0100 Subject: [PATCH] Refactor HTTP request handling in InvokeRecActionCommand Replaced the `reqMsg` variable with `httpReq` to simplify the creation and usage of `HttpRequestMessage`. The `request.RestType` is now used directly to create `httpReq`, which is passed to `http.SendAsync`. This change reduces redundancy and improves code clarity. --- .../RecActions/Commands/InvokeRecActionCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs index 4c92de5..f40ea25 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs @@ -36,11 +36,11 @@ public class InvokeRecActionCommandHandler( return; } - using var reqMsg = request.RestType + using var httpReq = request.RestType .ToHttpMethod() .ToHttpRequestMessage(request.EndpointUri); - using var response = await http.SendAsync(reqMsg, cancel); + using var response = await http.SendAsync(httpReq, cancel); var body = await response.Content.ReadAsStringAsync(cancel); var headers = response.Headers.ToDictionary(); }