add some debug logging

This commit is contained in:
2024-10-24 06:15:45 +02:00
parent 88c2817f7e
commit 8f7d8839bf

View File

@@ -65,13 +65,19 @@ public class ApiClient(string apiUrl) : IApiClient
var url = ApiUrl + route;
HttpContent content;
Log.DebugFormat("Api endpoint url is {0}", url);
if (message is not null)
content = new StringContent(serializer.Serialize(message)!, null, "application/json");
else
content = new StringContent(string.Empty, null, "application/json");
Log.Debug("Content created.");
content.Headers.Add("API-AUTH-KEY", EncodeAuthKey());
Log.Debug("Sending request...");
return await httpClient.PostAsync(url, content);
}