In my java web application I have a rest service to receive files via post as below:
@Path("/upload")
@Component
public class UploadResource {
private Logger logger = LoggerFactory.getLogger(getClass());
@POST
@Path("/files")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void uploadFiles(@RequestParam("files") MultipartFile[] multipartFiles, @RequestParam("email") String email) {
for (MultipartFile multipartFile : multipartFiles) {
//Do something
}
}
}
I would like an example of how to implement a client that is able to send a list of files all in one time for that service using apache HttpClient. Can someone help me?