I am using HtmlUnit to upload a file by making a request to the spring controller. The file is of type MultipartFile. Using the below code works only for File Type java.io.File. How do i make the call for MultipartFile?
WebRequest request = new WebRequest(new URL("/customer/uploadfile),POST);
request.setRequestParameters(toList(new KeyDataPair("newfile", file,"customerfile", "multipart/form-data", StandardCharsets.UTF_8)));