Internally we should just have one "body" datamember, which would be an InputStream. When setting the request body, if the streamBody() form is used, its trivial. When the stringBody() is used, create a StringInputStream which is easy. When the parametersBody() form is used, url encode it to a string, and use that as the input stream, also easy.
I am not sure if we can totally do away with additional byte[] buffer member variable, unless you are prepared to completely sacrifice ability to repeat requests (if case of re-authentication, for instance). It may be a reasonable thing to do, though, as it turns out Post & Put requests MUST NOT be automatically redirected without user intervention according to RFC 2616

No redirection does work in our favour. Not sure what to do about the authentication issue. It would be really lame to post a multi-megabyte file only to be challenged for authentication and have to resend. We can buffer small bodies, but not big ones. With stringBody and and parametersBody at least we know how big they are, and perhaps there could be some decision to buffer.
The client really should do a HEAD before a POST so authentication is performed before large files are sent over the wire.

Jandalf.


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



Reply via email to