mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-19 15:27:48 +01:00
21 lines
581 B
C#
21 lines
581 B
C#
// 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 |