Last post Feb 02, 2006 05:19 AM by Mark_Elford
Jan 31, 2006 04:43 AM|Mark_Elford|LINK
Can anyone help with this problem, I am trying to send a form post via inline code.
The code is to be automated so hence to form post.
I have tried the following code and whilst my test recieve form recieves a data stream the content of it can not be resolved back to give me a sensible querystring...
I would appreciate it if any experts out there could take a look and let me know where I am going wrong.
txtResult.Text = readHtmlPage("http://localhost/IntranetApplications/recievepost/WebForm1.aspx");
postData = "Servername=" + Servername.Value;
postData += "&Username=" + Username.Value;
postData += "&Password=" + Password.Value;
postData += "&AcknowledgementTo=" + AcknowledgementTo.Value;
postData += "&XML=" + XML.Value;
StreamWriter myWriter =
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "POST";
objRequest.ContentLength = postData.Length;
objRequest.ContentType = "text/xml";
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
result = sr.ReadToEnd();
Feb 01, 2006 07:43 PM|Jigar|LINK
Probaby this working sample might help you.
Posting form data to remote website using HttpWebRequest
Feb 02, 2006 05:19 AM|Mark_Elford|LINK
Still no joy, I am still getting the same problem when trying to read the querystring back.
reader.ReadToEnd() = recieves the following
However when my app recieves the post...
I get the following
Object reference not set to an instance of an object.
I am assuming the post is not correctly specified.