About Me

My photo
a Dynamic and Energetic guy.....

Thursday, July 23, 2009

Get the response of web request programatically

StreamReader responseReader = null;
HttpWebRequest httpRequest = null;
httpRequest = (HttpWebRequest)WebRequest.Create("http://172.21.0.60:8034/");
httpRequest.Method = "GET"; // User get data

HttpWebResponse webResponse = null;
webResponse = (HttpWebResponse)httpRequest.GetResponse();
Encoding enc = Encoding.Default;
responseReader = new StreamReader(webResponse.GetResponseStream(), enc);
String temp = responseReader.ReadToEnd();

No comments:

My Masters