How to read the response stream before the Http response completes

Posted by Marwan Aouida on Stack Overflow See other posts from Stack Overflow or by Marwan Aouida
Published on 2010-05-15T22:29:10Z Indexed on 2010/05/15 22:40 UTC
Read the original article Hit count: 319

When making a request using HttpWebRequest object, I need to call the method GetResponse() to send the request and get the response back.
The problem with this method is that it doesn't return the response object until all data has been received. Say I am downloading a 100 MB file, I won't be able to read it until the response finish and all the 100 MB is downloaded.
What I want is to be able to read the response stream bytes as soon as they arrive, without waiting for the response to complete.
I know I can use the Range Http header, but it won't work on my situation.

© Stack Overflow or respective owner

Related posts about c#

Related posts about httpwebrequest