diff --git a/src/LibSql.Http.Client/Response/ResultReader.cs b/src/LibSql.Http.Client/Response/ResultReader.cs index 22714da..d36aaf6 100644 --- a/src/LibSql.Http.Client/Response/ResultReader.cs +++ b/src/LibSql.Http.Client/Response/ResultReader.cs @@ -138,8 +138,10 @@ public static async Task ParseAsync( HashSet? resultsToIgnore = null, CancellationToken cancellationToken = default) { - using var stream = new MemoryStream(); - await content.CopyToAsync(stream, cancellationToken); + await content.LoadIntoBufferAsync(); + + await using var stream = await content.ReadAsStreamAsync(cancellationToken); + stream.Seek(0, SeekOrigin.Begin); return await ParseAsync(stream, resultsToIgnore, cancellationToken);