Irmen de Jong wrote:
Why isn't there a setRequestBody that takes a byte[] ?

To avoid request buffering.


Currently I've solved this by using the InputStream version:
method.setRequestHeader("Content-type", "text/xml; charset=UTF-8");
method.setRequestBody(new java.io.ByteArrayInputStream(xmlDocument));

This is the correct way of doing it. If your XML file is large, you should even consider going through the file system and provide a FileInputStream to avoid buffering.


I can't use the String version of setRequestBody because I don't know
how that one encodes the String in the message (that isn't documented?).

The encoding is specified in the Content-Type header (like in your example). And yes, we should document that (done now)!


Thanks in advance for any comments/suggestions on this.

--Irmen de Jong

PS I'm not on the mailing list, so please reply privately too...

Interesting that you were allowed to post, then :-)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- _________________________________________________________________ NOSE applied intelligence ag [www] http://www.nose.ch ortwin gl�ck [email] [EMAIL PROTECTED] hardturmstrasse 171 [pgp key] 0x81CF3416 8005 zurich [office] +41-1-277 57 35 switzerland [fax] +41-1-277 57 12


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to