Skip to content
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

Closed
andrueastman opened this issue Jun 12, 2023 · 0 comments · Fixed by #114
Closed
Assignees
Labels
enhancement New feature or request

Comments

@andrueastman
Copy link
Member

Related to microsoftgraph/msgraph-sdk-dotnet#1954

For calls to SendPrimitiveAsync<Stream> we should pass the HttpCompletionOption.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.

@baywet baywet added the enhancement New feature or request label Jun 12, 2023
@baywet baywet added this to Kiota Jun 12, 2023
@baywet baywet moved this to Todo in Kiota Jun 12, 2023
@andrueastman andrueastman moved this from Todo to In Progress in Kiota Jun 14, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Kiota Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants