shimgo
5/22/2018 - 10:49 AM

urlパラメータに配列をセットする

HttpPost httpPost = new HttpPost(url);
 
List<NameValuePair> para = new ArrayList<NameValuePair>() ;
for( String hoge : list ) {
    para.add( new BasicNameValuePair("hoge[]", hoge));
}
httpPost.setEntity(new UrlEncodedFormEntity( para, "UTF-8"));
HttpResponse response = httpclient.execute(httpPost);