Making HTTP Requests Without a Browser

Expains how to Making HTTP Requests Without a Browser through program.

Create one console project.and few lines of code given below.

Using System.Net;
using System.IO;

static void Main(string[] args)
WebRequest req = WebRequest.Create("");
WebResponse response = req.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream(),Encoding.ASCII);


And see the output in console window.


Author: krishnavenikaladi28 Feb 2010 Member Level: Gold   Points : 2

hi Bommala

I tried u'r code but i am getting following error.Can u correct me

Unhandled Exception: System.Net.WebException: The remote name could not be resol
ved: ''
at System.Net.HttpWebRequest.GetResponse()
at ConsoleApplication25.Program.Main(String[] args) in C:\Documents and Setti
ngs\house\My Documents\Visual Studio 2008\Projects\ConsoleApplication25\ConsoleA
pplication25\Program.cs:line 30
Press any key to continue . . .

Author: bommala02 Mar 2010 Member Level: Silver   Points : 1

hi krishnavenikaladi ,

Please make sure you type address correctly.
Type as in WebRequest.Create(..) function.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: