From 0f62cce341dfc1ff50d9f09c380b1e7ff65e43b3 Mon Sep 17 00:00:00 2001 From: Artem Levin <64748654+Leo506@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:18:19 +0500 Subject: [PATCH] Remove NativeHttpClient.GetString() (#55) Co-authored-by: Artem Levin --- src/Arbus.Network/INativeHttpClient.cs | 2 -- src/Arbus.Network/NativeHttpClient.cs | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/src/Arbus.Network/INativeHttpClient.cs b/src/Arbus.Network/INativeHttpClient.cs index 1e5c23e..ca17f0e 100644 --- a/src/Arbus.Network/INativeHttpClient.cs +++ b/src/Arbus.Network/INativeHttpClient.cs @@ -3,6 +3,4 @@ public interface INativeHttpClient { Task SendRequest(HttpRequestMessage request, CancellationToken cancellationToken, HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseHeadersRead); - Task GetString(string uri, TimeSpan? timeout = default); - Task GetString(Uri uri, TimeSpan? timeout = default); } \ No newline at end of file diff --git a/src/Arbus.Network/NativeHttpClient.cs b/src/Arbus.Network/NativeHttpClient.cs index c15a93c..a8832cf 100644 --- a/src/Arbus.Network/NativeHttpClient.cs +++ b/src/Arbus.Network/NativeHttpClient.cs @@ -22,17 +22,6 @@ public NativeHttpClient(INetworkManager networkManager) _networkManager = networkManager; } - public Task GetString(string uri, TimeSpan? timeout = null) => GetString(new Uri(uri), timeout); - - public async Task GetString(Uri uri, TimeSpan? timeout = null) - { - HttpRequestMessage request = new(HttpMethod.Get, uri); - if (timeout.HasValue) - request.SetTimeout(timeout.Value); - using var response = await SendRequest(request, CancellationToken.None).ConfigureAwait(false); - return await response.Content.ReadAsStringAsync().ConfigureAwait(false); - } - public virtual async Task SendRequest(HttpRequestMessage request, CancellationToken cancellationToken, HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseHeadersRead) { using var timeoutCts = GetTimeoutCts(request, cancellationToken);