2
Answers

HttpWebRequest

Administrator

Administrator

21y
2.2k
1
Hi, I am trying to write an application which will POST to a URL by sending values for text box controls and the submit button. For some reason, the application does not think that I have sent enough info for a button click. What could I be doing wrong? HttpWebResponse result = null; HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create("http://localhost/dispatcher"); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; byte [] bytes = null; string Parameters = "put_message=(filereadbuf)"; bytes = System.Text.Encoding.ASCII.GetBytes(Parameters); sr.Close(); request.ContentLength = bytes.Length; Stream OutputStream = request.GetRequestStream (); OutputStream.Write (bytes, 0, bytes.Length); OutputStream.Close (); result = (HttpWebResponse) request.GetResponse(); I get the following error: An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll Additional information: Error loading XML file file: in the main app.config Please help..
Answers (2)