I have string of text that needs to be cnoverted to base64 before being posted to a url. Here is my code
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uri);
byte[] postDataBytes = Encoding.UTF8.GetBytes(strCXML);
string returnValue = System.Convert.ToBase64String(postDataBytes);
req.Method = "POST";
req.ContentLength = postDataBytes.Length;
req.ContentLength = postDataBytes.Length;
Stream requestStream = req.GetRequestStream();
requestStream.Write(returnValue,0, postDataBytes.Length);
Problem is i get error on the last line System.IO.Stream.Write(byte[],int,int) returnValue is base64 string cant be used as byte[] needed in stream.writer Any idea how to take that that base64 string called returnvalue and put it to a url thanks