我的方法遇到了一些麻烦,我可以打印地图,如果其中只有1个项目,但是如果我放了超过1个,我会遇到一个超出范围的异常,我有没有某些事情执行不正确?
public static Result update(){
//get the body of the request
RequestBody body = request().body();
//Assign the type as MultipartFormData
Http.MultipartFormData multippartBody = body.asMultipartFormData();
// Pull the video from the MultipartFormData
Http.MultipartFormData.FilePart videoFile = multippartBody.getFile("fileKey");
// Pull the hashMap from the MultipartFormData
Map<String, String[]> myMap = multippartBody.asFormUrlEncoded();
System.out.println(myMap.size());
// Loop to print the contents of the hashMap
for(int i =0; i < myMap.size(); i++){
String param = "param" + (i + 1);
System.out.println(myMap.get(param)[i]);
}
}