Re: InputStream part source

2003-07-17 Thread Ortwin Glück
David Sean Taylor wrote: This implies that I can't contribute the InputStreamPartSource to your codebase as is, since it will be coupled to my particular InputStream factory. Right, because the InputStreamPartSource can (by design) not fulfill the contract of the createInputStream method without

Re: InputStream part source

2003-07-17 Thread David Sean Taylor
On Thursday, July 17, 2003, at 03:36 PM, Adrian Sutton wrote: In reading Adrian's recommendation, it sounds like I can't be guaranteed that it will call createInputStream only once Does the two settings above guarantee that createInputStream will be called only once, or should I adjust the Inpu

Re: InputStream part source

2003-07-17 Thread Adrian Sutton
In reading Adrian's recommendation, it sounds like I can't be guaranteed that it will call createInputStream only once Does the two settings above guarantee that createInputStream will be called only once, or should I adjust the InputStreamPartSource to handle the case where HttpClient asks for

Re: InputStream part source

2003-07-17 Thread David Sean Taylor
On Thursday, July 17, 2003, at 02:43 PM, Oleg Kalnichevski wrote: - another option is to use the "Expect: 100-continue" header. This feature requires HTTP 1.1 and is not well supported by all web servers. Try HttpMethod.setRequestHeader("Expect", "100-continue") David, one small correction

Re: InputStream part source

2003-07-17 Thread Oleg Kalnichevski
> - another option is to use the "Expect: 100-continue" header. This > feature requires HTTP 1.1 and is not well supported by all web servers. > Try HttpMethod.setRequestHeader("Expect", "100-continue") > David, one small correction. Instead of setting HttpMethod.setRequestHeader("Expect",

Re: InputStream part source

2003-07-17 Thread Michael Becke
- another option is to use the "Expect: 100-continue" header. This feature requires HTTP 1.1 and is not well supported by all web servers. Try HttpMethod.setRequestHeader("Expect", "100-continue") Small addendum... You can actually call MultipartPostMethod.setUseExpectHeader(true) instead.

Re: InputStream part source

2003-07-17 Thread Michael Becke
Hello David, As per the PartSource Javadocs, PartSource.createInputStream() can be called more than once. Each call is expected to return a fresh InputStream. PartSource behaves this way as there are some cases where POST content must be sent more than once. Here are a few things you can try

Re: InputStream part source

2003-07-17 Thread Adrian Sutton
Hi David, This sounds like normal behaviour though it seems wierd at first. The reason you need to be able to recreate the input stream is because HttpClient sometimes needs to recreate and resend the entire request. The most common cause for this is when the server requires authentication,

Re: InputStream part source

2003-07-17 Thread David Sean Taylor
On Thursday, July 17, 2003, at 01:22 PM, David Sean Taylor wrote: Is this a bug are normal/required behavior? ..^ My first post on the list and I can't even type english. Meant to say: Is this a bug OR normal/required behavior? -- David Sean Taylor Bluesunrise Software [EM

InputStream part source

2003-07-17 Thread David Sean Taylor
I created a little class called InputStreamPartSource to wrapper an input stream as a part source. MultipartPostMethod post = new MultipartPostMethod("http://192.168.1.4:8080/someServlet";); InputStreamPartSource source = new InputStreamPartSource(stream, "business.xml"); FilePart part = ne