I am trying to post a json formatted file and csv formatted file using a curl command.
Here is my spring boot endpoint:
@PostMapping
public MyDTO registerMyEntity(
@RequestBody MyDTO myDTO ,
@RequestParam("file") MultipartFile file) {...}
My json file myJsonFile.json contains this:
{
"key1": "value1",
"key2": "key2"
}
and my csv file myCSVFile contains this:
key3;key4
value3;value4
I used this curl (after having tried many many many ones):
curl -X POST -H 'Content-Type: multipart/form-data' -d @./import.json -F 'file=@./import.csv;text/csv' http://localhost:8080/path/to/endpoint
but no way... Any suggestions ?