Joan Venge Joan Venge - 4 months ago 32
C# Question

How to convert WebResponse.GetResponseStream return into a string?

I see many examples but all of them read them into byte arrays or 256 chars at a time, slowly. Why?

Is it not advisable to just convert the resulting

value into a string where I can parse it?


You should create a StreamReader around the stream, then call ReadToEnd.

You should consider calling WebClient.DownloadString instead.