HttpWebRequest

HttpWebRequest


Simple HttpWebRequest  C# 

We will post parameters u=my_yahooID and Display style m=s and t=8

to yahoo server opi.yahoo.com it will tell the yahoo user online status online / offline.

protected
void Button1_Click(object sender, EventArgs e)

{

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://opi.yahoo.com/online?u=my_yahooid&m=s&t=8"); // setting up connection with web and posting

HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Returns httpwebresponse

StreamReader reader = new StreamReader(response.GetResponseStream());

Response.Write(reader.ReadToEnd());

}

 

HttpWebRequest Post methodHttpWebRequest and yahooHttpWebRequestHttpWebRequest TimeoutHow to use HttpWebRequest and HttpWebResponse.c# send SMS (Text)c# port scannerWhere is my IP locationCheck Email AddressASP.net monitor server Bulk Email

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.