Hello Hareesh,

MultipartRequestEntity is what you are looking for, not
MultipartPostMethod.

Please avoid cross-posting to both our mailing lists.
Most developers will monitor the user list anyway
and those that don't do it for a reason.

cheers,
  Roland




"Kadlabalu, Hareesh" <[EMAIL PROTECTED]> 
24.07.2005 19:28
Please respond to
"HttpClient User Discussion"


To
"Httpclient-Dev (E-mail)" <[email protected]>, 
"Httpclient-User List (E-mail)" <[email protected]>
cc

Subject
PostMethod Vs MultipartPostMethod






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]




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

Reply via email to