This commit is contained in:
Stef Heyenrath
2026-02-21 17:21:18 +01:00
parent 43a26ec4bc
commit 43be85a88a
27 changed files with 306 additions and 281 deletions

View File

@@ -8,12 +8,12 @@ namespace System.Net.Http;
/// </summary>
internal static class HttpClientExtensions
{
public static Task<Stream> GetStreamAsync(this HttpClient client, Uri requestUri, CancellationToken _)
public static Task<Stream> GetStreamAsync(this HttpClient client, string requestUri, CancellationToken _)
{
return client.GetStreamAsync(requestUri);
}
public static Task<HttpResponseMessage> GetAsync(this HttpClient client, Uri requestUri, CancellationToken _)
public static Task<HttpResponseMessage> GetAsync(this HttpClient client, string requestUri, CancellationToken _)
{
return client.GetAsync(requestUri);
}

View File

@@ -13,9 +13,19 @@ internal static class HttpContentExtensions
return content.ReadAsStringAsync();
}
public static Task<string> ReadAsStringAsync(this StringContent content, CancellationToken _)
{
return content.ReadAsStringAsync();
}
public static Task<byte[]> ReadAsByteArrayAsync(this HttpContent content, CancellationToken _)
{
return content.ReadAsByteArrayAsync();
}
public static Task<byte[]> ReadAsByteArrayAsync(this ByteArrayContent content, CancellationToken _)
{
return content.ReadAsByteArrayAsync();
}
}
#endif