I wish to append a List<Beans>
in a HTTP Post request.
While making use of Apache HTTPClient
, I am unable to do the same.
This is what I wish to do:
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("dailySalesList",beanList));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
However, the BasicNameValuePair seems to take only 2 Strings as argument. I wish to utilize it so that I can use a String - for identification and Object - to pass a List. Basically a functionality similar to using a Map.
Any pointers on how it can be done using Apache HTTPClient
?