Is it possible to set 2 entities for a HttpPost? Like:
HttpPost post = new HttpPost("http://www.abc.com");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("A",
a));
nameValuePairs.add(new BasicNameValuePair("B", b));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
post.setHeader("Accept-Encoding", "gzip");
ByteArrayEntity bae = new ByteArrayEntity(compress(json));
post.setEntity(bae);
HttpResponse resp;
resp = client.execute(post);
I’m trying to achieve telling the server that there are some parameters and a zip file.
yes You can send zip file and pass parameter using nameValuePairs. go to below link you may get your solution.
http://vikaskanani.wordpress.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/
Android upload multi files to server via http post
in this link place your zip file address on place of image. and you may have to do some more modification.