diff --git a/OF DL.Core/Services/ApiService.cs b/OF DL.Core/Services/ApiService.cs index ada4c76..a672865 100644 --- a/OF DL.Core/Services/ApiService.cs +++ b/OF DL.Core/Services/ApiService.cs @@ -2773,7 +2773,7 @@ public class ApiService(IAuthService authService, IConfigService configService, protected async Task BuildHeaderAndExecuteRequests(Dictionary getParams, string endpoint, - HttpClient client) + HttpClient client, HttpMethod? method = null) { Log.Debug("Calling BuildHeaderAndExecuteRequests"); @@ -2789,15 +2789,18 @@ public class ApiService(IAuthService authService, IConfigService configService, protected Task BuildHttpRequestMessage(Dictionary getParams, - string endpoint) + string endpoint, HttpMethod? method = null) { Log.Debug("Calling BuildHttpRequestMessage"); - string queryParams = "?" + string.Join("&", getParams.Select(kvp => $"{kvp.Key}={kvp.Value}")); + string queryParams = ""; + + if (getParams.Count != 0) + queryParams = "?" + string.Join("&", getParams.Select(kvp => $"{kvp.Key}={kvp.Value}")); Dictionary headers = GetDynamicHeaders($"/api2/v2{endpoint}", queryParams); - HttpRequestMessage request = new(HttpMethod.Get, $"{Constants.ApiUrl}{endpoint}{queryParams}"); + HttpRequestMessage request = new(method ?? HttpMethod.Get, $"{Constants.ApiUrl}{endpoint}{queryParams}"); Log.Debug($"Full request URL: {Constants.ApiUrl}{endpoint}{queryParams}");