mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-23 18:01:47 +01:00
.
This commit is contained in:
21
test/WireMock.Net.Tests/Extensions/HttpContentExtensions.cs
Normal file
21
test/WireMock.Net.Tests/Extensions/HttpContentExtensions.cs
Normal file
@@ -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