minimal optimizations

This commit is contained in:
2024-10-24 09:11:45 +02:00
parent 24266789e8
commit b2a1cc2da8
2 changed files with 49 additions and 11 deletions

View File

@@ -67,16 +67,18 @@ public class ApiClient(string apiUrl) : IApiClient
Log.DebugFormat("Api endpoint url is {0}", url);
Log.Debug("Create content");
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.");
Log.Debug("Build headers");
content.Headers.Add("API-AUTH-KEY", EncodeAuthKey());
Log.Debug("Sending request...");
Log.Debug("Sending request");
return await httpClient.PostAsync(url, content);
}