From ff3908cdd27715470b4987fcead7d1793f1549c4 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 28 Nov 2025 23:24:36 +0100 Subject: [PATCH] Support HTTP request body in InvokeRecActionCommandHandler Added logic to handle non-null `request.Body` in HTTP requests. Introduced a `StringContent` object to encapsulate the body content and assigned it to the `Content` property of the HTTP request. This ensures that the request body is included when sending data to the specified endpoint. --- .../RecActions/Commands/InvokeRecActionCommand.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs index f40ea25..7f341cf 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs @@ -40,6 +40,12 @@ public class InvokeRecActionCommandHandler( .ToHttpMethod() .ToHttpRequestMessage(request.EndpointUri); + if(request.Body is not null) + { + using var reqBody = new StringContent(request.Body); + httpReq.Content = reqBody; + } + using var response = await http.SendAsync(httpReq, cancel); var body = await response.Content.ReadAsStringAsync(cancel); var headers = response.Headers.ToDictionary();