using Barcode.Host.Shared.Models; using Barcode.Host.Shared.Models.Stateless; using System.Text; namespace Barcode.Host.Server.Services; public class PostService : IPostService { private static Task PostAsync(string postTo, HttpClient httpClient, Notification notification) { Task result; string json = System.Text.Json.JsonSerializer.Serialize(notification); StringContent stringContent = new(json, Encoding.UTF8, "application/json"); result = httpClient.PostAsync(postTo, stringContent); return result; } Task IPostService.PostAsync(string postTo, HttpClient httpClient, Notification notification) { Task result = PostAsync(postTo, httpClient, notification); return result; } HttpResponseMessage IPostService.Post(string postTo, HttpClient httpClient, Notification notification) { HttpResponseMessage result; Task httpResponseMessage = PostAsync(postTo, httpClient, notification); httpResponseMessage.Wait(); result = httpResponseMessage.Result; return result; } }