how to read chunked type transfer- encoding data response using streamreader in c#?
<p>i'm using httpwebrequest and streamreader to get the response from third party URL but i can't able receive the data using streamreader..using restclient in google  i'm getting the response data headers like </p>

<p>Content-Type →application/json; charset=UTF-8 
Date →Sat, 30 Apr 2016 06:46:40 GMT 
Transfer-Encoding →chunked</p>

<p>also i receive a respective JSON data but while handling in streamreader in c# service side ,we get empty string.please find the below code</p>

<pre><code>HttpWebRequest req = WebRequest.Create(URL) as HttpWebRequest; 
req.ProtocolVersion = Version.Parse("1.1"); 
req.Method = dbresources.dbresouces.Method; 
req.ContentType = "application/json;charset=UTF-8" 
req.KeepAlive = false; 
req.Accept = "application/json; charset=UTF-8"; 
byte[] r1; 
string jsonString = JsonConvert.SerializeObject(constant, Newtonsoft.Json.Formatting.Indented); 
r1 = GetBytes(jsonString); 
req.ContentLength = r1.Length; 
System.IO.Stream RequestStream = req.GetRequestStream(); RequestStream.Write(r1, 0, r1.Length); 
RequestStream.Close(); 
System.IO.StreamReader Reader = new StreamReader(req.GetResponse().GetResponseStream()); 
var results = Encoding.UTF8.GetBytes(Reader.ReadToEnd()); 
string stringResponse = Reader.ReadToEnd();
</code></pre>

<p>we tried in bytes also,still have same problem which return empty byte.</p>

<pre><code>byte[] buffer;
using (var stream = req.GetResponse().GetResponseStream())
{
  using (var streamReader = new StreamReader(stream, Encoding.UTF8))
  {
    var content = new StringBuilder();
    while (!streamReader.EndOfStream)
    {
     content.Append((char)streamReader.Read());
    }
    buffer = Encoding.UTF8.GetBytes(content.ToString());
   }
 }
</code></pre>

<p>kindly advice on this to solve the issue.</p>