Skip to content

Commit

Permalink
Remove NativeHttpClient.GetString() (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: Artem Levin <[email protected]>
  • Loading branch information
Leo506 and Artem Levin authored Oct 17, 2023
1 parent 5835110 commit 0f62cce
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/Arbus.Network/INativeHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
public interface INativeHttpClient
{
Task<HttpResponseMessage> SendRequest(HttpRequestMessage request, CancellationToken cancellationToken, HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseHeadersRead);
Task<string> GetString(string uri, TimeSpan? timeout = default);
Task<string> GetString(Uri uri, TimeSpan? timeout = default);
}
11 changes: 0 additions & 11 deletions src/Arbus.Network/NativeHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ public NativeHttpClient(INetworkManager networkManager)
_networkManager = networkManager;
}

public Task<string> GetString(string uri, TimeSpan? timeout = null) => GetString(new Uri(uri), timeout);

public async Task<string> 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<HttpResponseMessage> SendRequest(HttpRequestMessage request, CancellationToken cancellationToken, HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseHeadersRead)
{
using var timeoutCts = GetTimeoutCts(request, cancellationToken);
Expand Down

0 comments on commit 0f62cce

Please sign in to comment.