title: HttpWebResponse.GetResponseStream(): when is the response body transmitted?
body: <p>I'm using the <a href="http://msdn.microsoft.com/en-us/library/8y7x3zz2.aspx" rel="nofollow">System.Net.HttpWebRequest</a> class to implement a simple HTTP downloader that can be paused, canceled and even resumed after it was canceled (with the HTTP Range request header).</p>
  
  <p>It's clear that HttpWebRequest.GetResponse() is when the HTTP request is actually sent to the server, and the method returns when a HTTP response is received (or a timeout occurs). However, the response body is represented with a Stream, which leaves me wonder whether the response body is actually transmitted with the response header (i.e. it's already downloaded when GetResponse() returns), or is it only downloaded on-demand, when I try to read from the response stream? Or maybe when I call the HttpWebResponse.GetResponseStream() method?</p>
  
  <p>Unfortunately the msdn documentation doesn't tell, and I don't know enough about the HTTP protocol to be able to tell.</p>
  
  <p>How do chunked transfers and the like behave in this case (that is, how should I handle them in my C# application)? When is actually the response data downloaded from the server?</p>