1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-05 02:41:10 +00:00

Pass CancellationToken to Content.ReadAsStreamAsync (#262)

This commit is contained in:
Jonnern
2025-12-15 16:33:06 +01:00
committed by GitHub
parent f3d535f286
commit f125bc88b0
5 changed files with 16 additions and 9 deletions
+9 -4
View File
@@ -1,11 +1,12 @@
using System;
using CryptoExchange.Net.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using CryptoExchange.Net.Interfaces;
namespace CryptoExchange.Net.Requests
{
@@ -41,9 +42,13 @@ namespace CryptoExchange.Net.Requests
}
/// <inheritdoc />
public async Task<Stream> GetResponseStreamAsync()
public async Task<Stream> GetResponseStreamAsync(CancellationToken cancellationToken)
{
return await _response.Content.ReadAsStreamAsync().ConfigureAwait(false);
#if NET5_0_OR_GREATER
return await _response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
#else
return await _response.Content.ReadAsStreamAsync().ConfigureAwait(false);
#endif
}
/// <inheritdoc />