spring boot rest总是收到@RequestParam作为空值。
例如:
@RequestParam(name = "param", required = false) String param,
@RequestParam(name = "file", required = false) MultipartFile file)
浏览器能够在表单数据下看到以下两个参数
file: (binary)
param: {"name:"test"}
也使用此consumes = MediaType.MULTIPART_FORM_DATA_VALUE
这就是我发送的邮件
formdata = new FormData();
formdata.append("file", file);
formdata.append("param", obj);
return this.httpClient.post(encodeURI(${this.URL}), formdata, options)