namespace ReC.Application.Common; public static class HttpExtensions { public static HttpMethod ToHttpMethod(this string method) => method.ToUpper() switch { "GET" => HttpMethod.Get, "POST" => HttpMethod.Post, "PUT" => HttpMethod.Put, "DELETE" => HttpMethod.Delete, "PATCH" => HttpMethod.Patch, "HEAD" => HttpMethod.Head, "OPTIONS" => HttpMethod.Options, "TRACE" => HttpMethod.Trace, _ => throw new ArgumentException($"Invalid HTTP method: {method}", nameof(method)), }; }