M
ME
Hi;
I am getting "Unhandled Exception:
System.Net.WebException: The remote server returned an erro
r: (401) Unauthorized."
when I am trying to get a page via post. Code follows...
System.Text.ASCIIEncoding encoding = new
System.Text.ASCIIEncoding();
string postData="age=23&state=47";
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)
WebRequest.Create"http://localhost/index.asp");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream=myRequest.GetRequestStream();
newStream.Write(data,0,data.Length);
newStream.Close();
System.IO.StreamReader st = new StreamReader
(((HttpWebResponse)myRequest.GetResponse
()).GetResponseStream());
Console.Write(st.ReadLine());
PLEASE HELP ME.... I AM BADLY STUCK <weeping>
mE
I am getting "Unhandled Exception:
System.Net.WebException: The remote server returned an erro
r: (401) Unauthorized."
when I am trying to get a page via post. Code follows...
System.Text.ASCIIEncoding encoding = new
System.Text.ASCIIEncoding();
string postData="age=23&state=47";
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)
WebRequest.Create"http://localhost/index.asp");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream=myRequest.GetRequestStream();
newStream.Write(data,0,data.Length);
newStream.Close();
System.IO.StreamReader st = new StreamReader
(((HttpWebResponse)myRequest.GetResponse
()).GetResponseStream());
Console.Write(st.ReadLine());
PLEASE HELP ME.... I AM BADLY STUCK <weeping>
mE