forked from sim0n00ps/OF-DL
Enabled setting HttpMethod
This commit is contained in:
parent
6a9c48bf3e
commit
cdfe83b8dd
@ -2773,7 +2773,7 @@ public class ApiService(IAuthService authService, IConfigService configService,
|
||||
|
||||
|
||||
protected async Task<string?> BuildHeaderAndExecuteRequests(Dictionary<string, string> 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<HttpRequestMessage> BuildHttpRequestMessage(Dictionary<string, string> 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<string, string> 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}");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user