我正在使用MultipartEntityBuilder类在服务器上上传多个图像。 与多个图像,我想发送job_id这是整数类型,但它不支持,它仅支持String和It给我编译时错误。
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
for (int i = 0; i < returnImageValue.size(); i++) {
FileBody fileBodyImage = new FileBody(new File(returnImageValue.get(i)));
multipartEntityBuilder.addPart("upload_image[]", fileBodyImage);
}
multipartEntityBuilder.addPart("job_id", 1);// In this line I want to use job_id as integer, but it did not work. It is getting me compile time error.
请建议我如何解决。