ASP.NET 1.0 and 1.1 ProfessionalFor advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I'm trying to make a post request to a site.
If I use a normal browser I get a different response than if I use HttpWebRequest.
This is one example. I'm seemingly not successfully posting to any of these sites. I created a site of my own that would read the request vars and return a response. That one works fine but this other one doesn't.
well fellow ur problem is solved. iam sending u the code. implement it.
string url="http://www.365articles.com/modules.php?name=Your_Account";
string data="username=gogo&user_password=newnewne&op=logi n";
byte[] buffer=Encoding.UTF8.GetBytes(data);
string result="";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.ContentType ="application/x-www-form-urlencoded";
req.ContentLength = buffer.Length;
//req.Proxy = new WebProxy(proxy, true); // ignore for local addresses
req.CookieContainer = new CookieContainer(); // enable cookies
Stream reqst = req.GetRequestStream(); // add form data to request stream