title: Getting response of http request without content-length?
body: <p>I have a little program sends http request and gets response with TCP protocol.</p>
  
  <p>My request format;</p>
  
  <pre><code>GET / HTTP/1.0
  Host: somewebsite.com
  {two new line}
  </code></pre>
  
  <p>I read response line by line from socket (using NetworkStream and StreamReader in c#) until I find content-length header. I store the length, then continue reading until find an empty line. Then create a buffer with the length and receive the rest of response.</p>
  
  <p>But some reponses does not have a content-length header. So my approach fails. If I don't know how many bytes I should receive, when I should stop?</p>