What is the best way to read GetResponseStream() ?
- by Dev Dona
What is the best way to read an HTTP response from GetResponseStream ?
Currently I'm using the following approach.
Using SReader As StreamReader = New StreamReader(HttpRes.GetResponseStream)
SourceCode = SReader.ReadToEnd()
End Using
I'm not quite sure if this is the most effecient way to read an http response.
I need the output as string, I've seen an article ( http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=583 ) with a different approach but I'm not quite if it's a good one. And in my tests that code had some encoding issues with in different websites.
How do you read web responses?