This is driving me nuts:
WebRequest request = WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = Encoding.UTF8.GetByteCount(data);
Stream reqs = request.GetRequestStream();
StreamWriter stOut = new StreamWriter(reqs, Encoding.UTF8);
stOut.Write(data);
stOut.Flush();
I get an exception that I've run out of bytes in the stream...but I've used the same encoding to get the byte count!
Using ASCII this doesn't fail. Is this because of the UTF-8 BOM that Windows likes to add in?