Add response body and headers processing

In the `InvokeRecActionCommandHandler` class, added code to read the response content as a string and store it in a `body` variable. Also, converted response headers into a dictionary and stored them in a `header` variable. These changes facilitate further processing of the response content and headers.
This commit is contained in:
Developer 02 2025-11-26 17:49:01 +01:00
parent 904448ca45
commit 0837bca6cb

View File

@ -37,6 +37,9 @@ public class InvokeRecActionCommandHandler(ISender sender) : IRequestHandler<Inv
"TRACE" => await http.SendAsync(new HttpRequestMessage(HttpMethod.Trace, action.EndpointUri), cancel), "TRACE" => await http.SendAsync(new HttpRequestMessage(HttpMethod.Trace, action.EndpointUri), cancel),
_ => throw new BadRequestException($"The REST type {action.RestType} is not supported.") _ => throw new BadRequestException($"The REST type {action.RestType} is not supported.")
}; };
var body = await response.Content.ReadAsStringAsync(cancel);
var header = response.Headers.ToDictionary();
} }
} }
} }