Webrequest Question.

B

Bob

Hi,
I have a Webrequest that uses a XML doc for its 'body'
I need to know the length of the doc so I can set Webrequest header
ContentLength.
Currently I am using an XMLTextWriter to a filestream, reading that stream
back in to a Byte Array and writing the ByteArray to the Webrequest
poststream.
This solves the problem of the poststream not supporting the length property
and also the fact that you have to set the content length before you start
writing the poststream.
But...
There's got to be a better way.
How do I do this 'properly' i.e. keep it all in memory.
Thanks
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top