我试图找到一些关于这个的信息,但有点困难,因为我发现的都是关于 javascript 而不是 java,
我也想知道如何在 php 中获取它,因为我不知道该怎么做
我正在尝试通过邮寄传递一个多维数组,我不知道如何通过 java 传递一个多维数组这是我的代码(我想我只需要更改一些)
try
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://web");
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
for (int count=0; count < array.length; count++)
{//this loop is what i need to change but i dont know how to do it
nameValuePairs.add(new BasicNameValuePair("foto",array[count][0]));
nameValuePairs.add(new BasicNameValuePair("media",array[count][1]));
nameValuePairs.add(new BasicNameValuePair("votos",array[count][2]));
}
if(nameValuePairs != null) httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
ResponseHandler<String> responseHandler = new BasicResponseHandler();
httpclient.execute(httppost, responseHandler);
}