What is the best way to read GetResponseStream() ?

Posted by Dev Dona on Stack Overflow See other posts from Stack Overflow or by Dev Dona
Published on 2008-09-26T01:37:26Z Indexed on 2010/05/31 17:53 UTC
Read the original article Hit count: 180

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about http