I know that structure is different but im sure it possible to pass it without messing boundaryes cause i can d it with php and curl successfully. Ok heres an example how its possible with php.
$postdata = array('field1' => $field1value, 'field2' => $field2value, 'field3' => $field3value);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://somedomain.com/submit.php");
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1;en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 GTB6 (.NET CLR 3.5.30729)");
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
And it passes successfully.
But if ill try the same thing with c# like this:
string postData1 = "field1=" + feldvalue1+"&"; // Not sure how to post this as array
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://somedomain.com/submit.php");
myRequest.Method = "POST";
myRequest.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 GTB6 (.NET CLR 3.5.30729)";
myRequest.Timeout = 10000;
myRequest.ContentType = "multipart/form-data";
myRequest.ContentLength = postData.Length;
CookieContainer cookieJar = new CookieContainer();
myRequest.CookieContainer = cookieJar;
myRequest.KeepAlive = true;
myRequest.AllowAutoRedirect = true;
StreamWriter myWriter = new StreamWriter(myRequest.GetRequestStream());
myWriter.Write(postData1);
myWriter.Close();
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
StreamReader myReader = new StreamReader(myResponse.GetResponseStream());
string output = myReader.ReadToEnd();
myReader.Close();
myResponse.Close();
I know i must be missing something but if its possible with php then it's possible with c# as well.
I pretty new with c# so i just wont find the right way yet. There's many examples how to upload file but basically none how to process normal form fields.