hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kadlabalu, Hareesh" <hareesh.kadlab...@fatwire.com>
Subject PostMethod Vs MultipartPostMethod
Date Sun, 24 Jul 2005 17:28:07 GMT
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: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message