Great, I got it working... sorta...
I get a response:
{"This request requires buffering of data for authentication or redirection to be successful."}
It's an apache server, so there's no IIS authentication..
myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(myReceiverUrl);
myHttpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
myHttpWebRequest.Method = "POST";
myHttpWebRequest.KeepAlive = true;
myHttpWebRequest.Credentials = credentials;
//myHttpWebRequest.PreAuthenticate = true;
myHttpWebRequest.AllowWriteStreamBuffering = false;
myHttpWebRequest.Timeout = 10000;
myHttpWebRequest.ContentLength = length;
//Open the stream to the server
requestStream = myHttpWebRequest.GetRequestStream();
-----All the data is sent----
//All uploading is complete, close the stream
requestStream.Close();
HttpWebResponse httpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(httpWebResponse.GetResponseStream());
httpWebResponse.Close();
httpWebResponse = null;
On HttpWebResponse httpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); I get that error:
{"This request requires buffering of data for authentication or redirection to be successful."}