Requestbody with FormData is always empty

Viewed 32

I am sending a post request via axios

axios.post("path", formData ,{ headers: { 'Content-Type': 'multipart/form-data' } });

The payload of this request contains the file content as well as the name,...

But

@PostMapping("path")
fun importCSV(@RequestPart files: MultipartFile?) = service.someaction(files)

files is always null (I am using Rest api in Kotlin).

0 Answers
Related