Skip to content

Commit 3274d75

Browse files
refactor(client): move some defaults out of ClientOptions
1 parent 04be863 commit 3274d75

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/ArcadeDotnet/Core/HttpResponse.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.IO;
32
using System.Net.Http;
43
using System.Text.Json;
54
using System.Threading;
@@ -23,7 +22,7 @@ public async Task<T> Deserialize<T>(CancellationToken cancellationToken = defaul
2322
try
2423
{
2524
return JsonSerializer.Deserialize<T>(
26-
await this.ReadAsStream(cts.Token).ConfigureAwait(false),
25+
await Message.Content.ReadAsStreamAsync(cts.Token).ConfigureAwait(false),
2726
ModelBase.SerializerOptions
2827
) ?? throw new ArcadeInvalidDataException("Response cannot be null");
2928
}
@@ -33,15 +32,6 @@ await this.ReadAsStream(cts.Token).ConfigureAwait(false),
3332
}
3433
}
3534

36-
public async Task<Stream> ReadAsStream(CancellationToken cancellationToken = default)
37-
{
38-
using var cts = CancellationTokenSource.CreateLinkedTokenSource(
39-
this.CancellationToken,
40-
cancellationToken
41-
);
42-
return await Message.Content.ReadAsStreamAsync(cts.Token).ConfigureAwait(false);
43-
}
44-
4535
public async Task<string> ReadAsString(CancellationToken cancellationToken = default)
4636
{
4737
using var cts = CancellationTokenSource.CreateLinkedTokenSource(

0 commit comments

Comments
 (0)