hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cory Lum <cory....@oracle.com>
Subject RE: Multiple entities in single Post?
Date Fri, 14 Dec 2012 21:44:28 GMT
Just like to add that on server side, I wish to use request.getParameter("paramname");
If I use entity.addPart("paramname", new StringBody("paramvalue"), the above returns null;

-----Original Message-----
From: Cory Lum 
Sent: Friday, December 14, 2012 4:20 PM
To: httpclient-users@hc.apache.org
Subject: Multiple entities in single Post?



I'm trying to include request parameters and a multipart upload in a single Post. Is it possible?


HttpPost post = HttpPost();

//adding params

List <NameValuePair> params = .; //assume params

post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));


//over writes params

MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);

entity.addPart(.); //assume data



How to set two type of entities?




To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message