What is the most robust way to make http request [closed]
I usually use this approach to make sure all http classes are properly disposed and nothing is left hanging in memory:
HttpWebRequest request = WebRequest.Create("http://xxxx") as HttpWebRequest;
using (HttpWebResponse response = request.GetResp开发者_C百科onse())
using (Stream stream = response.GetResponseStream())
... do my stuff ...
Any better idea?
精彩评论