B
Brad
I'm trying to fill out a form on a website from within a web service. I know
there is one field on that form called "call" and I want to put the value
"register" in it. I'm using the following code, but I can't get it to work.
Any Suggestions? I suspect the problem is in the way i'm specifying the
string to send because i get an answer saying the Call parameter was not set:
string myDataString= "<INPUT TYPE=\"hidden\" NAME=\"call\"
VALUE=\"register\">";
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(ConfigurationSettings.AppSettings["AdidasCUDSite"]);
request.Method = "POST";
request.ContentType = "text/xml";
byte[] postInfo = System.Text.UnicodeEncoding.ASCII.GetBytes(myDataString);
request.ContentLength = postInfo.Length;
Stream s = request.GetRequestStream();
s.Write(postInfo,0,postInfo.Length);
// execute the request
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// we will read data via the response stream
Stream resStream = response.GetResponseStream();
StreamReader reader = new StreamReader(resStream);
string responseStr = reader.ReadToEnd();
there is one field on that form called "call" and I want to put the value
"register" in it. I'm using the following code, but I can't get it to work.
Any Suggestions? I suspect the problem is in the way i'm specifying the
string to send because i get an answer saying the Call parameter was not set:
string myDataString= "<INPUT TYPE=\"hidden\" NAME=\"call\"
VALUE=\"register\">";
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(ConfigurationSettings.AppSettings["AdidasCUDSite"]);
request.Method = "POST";
request.ContentType = "text/xml";
byte[] postInfo = System.Text.UnicodeEncoding.ASCII.GetBytes(myDataString);
request.ContentLength = postInfo.Length;
Stream s = request.GetRequestStream();
s.Write(postInfo,0,postInfo.Length);
// execute the request
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// we will read data via the response stream
Stream resStream = response.GetResponseStream();
StreamReader reader = new StreamReader(resStream);
string responseStr = reader.ReadToEnd();