Hareesh,
If you want to include both a file and "form" parameters in a post
request you must use Multipart MIME and send both entities as separate
MIME parts.
Ortwin Glück
Kadlabalu, Hareesh wrote:
Hello,
I am trying to use PostMethod for sending multipart data using
PostMethod.setRequestEntity(..). I also want to conditionally add parameters
to it (using PostMethod.addParameter(..) ). However if I call
setRequestEntity() after calling addParameter(..), all parameters that are
set earlier are cleared. If I call the other way around, both are retained.
I searched the mail archives and came across a thread where it was suggested
that one must use MultipartPostMethod and send add whatever parameters I
would add as StringPart (along with any FilePart data).
However, MultipartPostMethod is deprecated and suggests the users to use
PostMethod instead.
Given that I want to both addParameter() and multipart data, which approach
should I choose? It seems that for MultiPart posts, parameters are not
preferred? Is there a change in HTTP specs that forces this?
Thanks
-Hareesh
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]