Hi i am trying to do a POST to a third party service and my post is not seeming to work correctly? my valuesxml
has all my XML in it, also my url
has a value set and i can see it when i watch it but it seems to not be posting my data properly. You see it connecting to the service but something must be wrong with my post method.
Here is my post
System.Net.HttpWebRequest request (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
string postdata = "DATA=" + valuexml.ToString();
byte[] postdatabytes = System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(postdata);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postdatabytes.Length;
System.IO.Stream requeststream = request.GetRequestStream();
requeststream.Write(postdatabytes, 0, postdatabytes.Length);
requeststream.Close();
Just wanted to see if anyone can see if my code is wrong or anything which could be happening and causing this to do it.