I created a restful api to upload a file to an external web service, but I need to send some kind of data in this request to, here is an example of the request :
"file" : <MultiPartFile>,
"data" : {...}
I mapped this request to this class :
@Data
class UploadFileRequest{
private MultiPartFile file;
private Data data;
}
here is the api :
@PostMapping
String uploadFile(@RequestBody UploadFileRequest input){
return service.uploadFile(input.getFile(), input.getData());
}
I want to know how to send this kind of request.