refit/Refit/HttpContentExtensions.cs

30 строки
831 B
C#
Исходник Постоянная ссылка Обычный вид История

using System.Net.Http;
2020-11-26 00:52:29 +03:00
namespace Refit
{
#if !NET6_0_OR_GREATER
2020-11-26 00:52:29 +03:00
static class HttpContentExtensions
{
2020-11-26 02:38:25 +03:00
#pragma warning disable IDE0079 // Remove unnecessary suppression
2020-11-26 02:05:34 +03:00
#pragma warning disable IDE0060 // Remove unused parameter
2023-11-27 01:50:46 +03:00
public static Task<Stream> ReadAsStreamAsync(
this HttpContent httpContent,
CancellationToken cancellationToken
)
2020-11-26 00:52:29 +03:00
{
return httpContent.ReadAsStreamAsync();
}
2023-11-27 01:50:46 +03:00
public static Task<string> ReadAsStringAsync(
this HttpContent httpContent,
CancellationToken cancellationToken
)
2020-11-26 00:52:29 +03:00
{
return httpContent.ReadAsStringAsync();
}
2020-11-26 02:05:34 +03:00
#pragma warning restore IDE0060 // Remove unused parameter
2020-11-26 02:38:25 +03:00
#pragma warning restore IDE0079 // Remove unnecessary suppression
2020-11-26 00:52:29 +03:00
}
2020-11-26 02:05:34 +03:00
#endif
2020-11-26 00:52:29 +03:00
}