DropboxRestAPI icon indicating copy to clipboard operation
DropboxRestAPI copied to clipboard

HttpClient.SendAsync not utilising HttpCompletionOption.ResponseHeadersRead

Open dv00d00 opened this issue 10 years ago • 0 comments

When downloading large files this line of code in RequestJsonString method of DropboxClient class

var response = await this.httpClient.SendAsync(request);

create buffer equal to the content length of the file being uploaded. And consumer of this method will be forced to wait before all content is downloaded. Which in my case is really bad, because of stream decryption on the client.

So the proposed solution will be to add additional parameter to the SendAsync call like this:

var response = await this.httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

This will allow to start content processing immediately after headers parsing and will preserve RAM on the consumer side.

dv00d00 avatar Oct 10 '15 15:10 dv00d00