E
ERobishaw
Using Winform app writing a HTTP Post using the following... on the
server side, I get no form fields. Request.Form.AllKeys.Length = 0.
If I put the field/value paris in the URL I can use
Request["FieldName"] to retrieve the values,
but POST doesn't work.
There is NO Proxy... the only thing I can think is that ASP.NET is
somehow filtering out the page because I'm obviously not posting the
viewstate??? Seems like there was some setting for this, but I can't
recall what it is.
HttpWebRequest request = (HttpWebRequest)
HttpWebRequest.Create("http://localhost/test.aspx");
WebResponse response;
string commentField = "ABCD=123";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(commentField);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();
response = request.GetResponse();
//SERVER SIDE, test.aspx page
Page_Load()
{
//BREAK POINT SET HERE>>>>
//Request.Form.AllKeys returns nothing (0 length)
}
server side, I get no form fields. Request.Form.AllKeys.Length = 0.
If I put the field/value paris in the URL I can use
Request["FieldName"] to retrieve the values,
but POST doesn't work.
There is NO Proxy... the only thing I can think is that ASP.NET is
somehow filtering out the page because I'm obviously not posting the
viewstate??? Seems like there was some setting for this, but I can't
recall what it is.
HttpWebRequest request = (HttpWebRequest)
HttpWebRequest.Create("http://localhost/test.aspx");
WebResponse response;
string commentField = "ABCD=123";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(commentField);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();
response = request.GetResponse();
//SERVER SIDE, test.aspx page
Page_Load()
{
//BREAK POINT SET HERE>>>>
//Request.Form.AllKeys returns nothing (0 length)
}