This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
Pass HttpCompletionOption.ResponseHeadersRead to HttpClient for Stream responses #110
Labels
enhancement
New feature or request
Related to microsoftgraph/msgraph-sdk-dotnet#1954
For calls to
SendPrimitiveAsync<Stream>
we should pass theHttpCompletionOption.ResponseHeadersRead
to the HttpClient to avoid the loading of the entire stream buffer into memory as the requested stream may be unnecessarily large.This could be done by passing the optional parameter once the return type is determined to be that of a Stream.
https://github.com/microsoft/kiota-http-dotnet/blob/main/src/HttpClientRequestAdapter.cs#L410
We can avoid this for other scenarios as typed return are not expected to run into this issue as the size is not expected to grow as much compared to an unknown Stream size.
The text was updated successfully, but these errors were encountered: