mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-05-27 09:09:10 +02:00
.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if !NET5_0_OR_GREATER
|
||||
namespace System.Net.Http;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for HttpContent to provide CancellationToken support in frameworks before .NET 5.0.
|
||||
/// </summary>
|
||||
internal static class HttpContentExtensions
|
||||
{
|
||||
public static Task<string> ReadAsStringAsync(this HttpContent content, CancellationToken _)
|
||||
{
|
||||
return content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
public static Task<byte[]> ReadAsByteArrayAsync(this HttpContent content, CancellationToken _)
|
||||
{
|
||||
return content.ReadAsByteArrayAsync();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user