المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Stream XML to HttpWebRequest



C# Programming
07-07-2009, 12:50 PM
Hi,

I need some help in finding the best way to stream the content of an XML file to a HttpWebRequest. This needs to be streamed as the xml contains a Base64 Encoded zip file. The XML is encoded using UTF-8 if this makes a difference? Previously I was just using

byte[] byteData = Encoding.UTF8.GetBytes(requestInfo.XML);

but this was under some circumstances causing me a OutOfMemory exception. I cant send the actual file so cant stream the file. What is the best way to stream the UTF8 xml data to the HttpWebRequest.

Thanks

Stu