using static CompServ.CompServConst; using HttpMethod = System.Net.Http.HttpMethod; using HttpVersion = System.Net.HttpVersion; namespace CompServ.ClientLibrary { public class CompServWorkerClient(string server) : CompServClient(server, ApiPathWorkerRootForCheckAlive, AliveMessageWorker) { public async Task CompressAsync(CompressRequestModel request) { var message = request.BuildRequestMessage(); var http = new HttpClient { BaseAddress = ServerUri }; var r = await http.SendAsync(message); r.EnsureSuccessStatusCode(); var compressedBytes = await r.Content.ReadAsByteArrayAsync(); return compressedBytes; } public async Task DecompressAsync(DecompressRequestModel request) { var message = request.BuildRequestMessage(); var http = new HttpClient { BaseAddress = ServerUri }; var r = await http.SendAsync(message); r.EnsureSuccessStatusCode(); var bytes = await r.Content.ReadAsByteArrayAsync(); return bytes; } } }