Here i wrote a function which is taking URL as parameter and gets response from that URL. Check it out...
private void CallHttpWebRequest(string URL)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sAddress);string sAddress = URL;
req.Accept = "text/xml,text/plain,text/html";
req.Method = "GET";
HttpWebResponse result = (HttpWebResponse)req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
StreamReader reader = new StreamReader(ReceiveStream, System.Text.Encoding.ASCII);
string respHTML = reader.ReadToEnd();
Response.Write(respHTML);
reader.Close();
}

Join the conversation! Your thoughts help the community grow.