3 Commits

Author SHA1 Message Date
21e3171e11 Refactor ToHttpMethod to use a dictionary for mappings
Replaced the switch statement in the ToHttpMethod method with
a case-insensitive dictionary for mapping HTTP method strings
to HttpMethod objects. Introduced a private static dictionary
to store predefined HTTP methods, including the addition of
the CONNECT method. Improved performance and maintainability
by leveraging dictionary lookups for faster and cleaner code.
2025-11-27 14:47:41 +01:00
7a4885c86a Refactor HTTP method handling and cleanup
Refactored HTTP method handling by introducing a `ToHttpMethod`
extension method in `HttpExtensions.cs` to convert string
representations of HTTP methods to `HttpMethod` objects.
Replaced manual `HttpMethod` instantiation with the new
extension method in `InvokeRecActionCommandHandler` for
improved readability and reusability.

Removed unused `using` directives from `HttpExtensions.cs`
and cleaned up the `namespace` declaration. Added a `using`
directive for `ReC.Application.Common` in
`InvokeRecActionCommand.cs` to support the new extension method.
2025-11-27 11:45:15 +01:00
a46d97467d Ensure proper disposal and add HttpExtensions class
Updated `InvokeRecActionCommand.cs` to use `using` statements for `HttpClient`, `HttpRequestMessage`, and `HttpResponseMessage` to prevent resource leaks.

Added a new `HttpExtensions.cs` file with a static `HttpExtensions` class as a placeholder for future HTTP-related extension methods. Included necessary `using` directives for potential LINQ, collections, and asynchronous programming.
2025-11-27 11:32:14 +01:00