You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Streaming API does not allow access to the HTTP status or the headers from the callback #827
This means that from within the body handler, there is no way to know what the HTTP status code was for the underlying request or what the headers were (most importantly the "Transfer-Encoding" header), even though the status code and the headers are parsed before the callback is invoked.
One workaround is to use the callback to simply assemble the body bytes, and then actually parse it after the request completes. This, however, won't work for hanging gets, where the data is coming in incrementally.
I'd like to augment the API to allow the callback to access the underlying http_async_protocol_handler fields (including the promises and is_chunk_encoding), most likely via the underlying response object. There is a way to make it backward compatible by overloading on a 2-parameter callback.
@deanberris, would you entertain a PR with such a change?
Hi @igorpeshansky,
Async client support for chunked transfer encoding has been added to the master branch. See #720.
You still have to set the remove_chunk_markers option to get rid of the encoding bits enclosing each chunk. I pushed it to the master branch only because it is rather a large change.
If I knew in advance that there were still so many commits going into the 0.13 release, I would have pushed to 0.13 branch as well.
Activity
umennel commentedon Mar 5, 2018
Hi @igorpeshansky,
Async client support for chunked transfer encoding has been added to the master branch. See #720.
You still have to set the remove_chunk_markers option to get rid of the encoding bits enclosing each chunk. I pushed it to the master branch only because it is rather a large change.
If I knew in advance that there were still so many commits going into the 0.13 release, I would have pushed to 0.13 branch as well.
deanberris commentedon Mar 6, 2018
Hi @igorpeshansky -- Yes, please send a PR through for an overload of the streaming body handler.
@umennel -- If you can get the chunked transfer encoding from master cherry-picked and/or ported to 0.13-release, then that would be great too.