在我的Spring REST WS代码中:
我正在使用Spring MultiPartFile
@RequestMapping(value = "/create", consumes=MediaType.MULTIPART_FORM_DATA_VALUE, method = RequestMethod.POST)
@ResponseBody
public String uploadFileAndSaveData(@RequestBody Person person, @RequestParam("file") MultipartFile file) throws Exception {
// do something to save the map to db
}
继承我的JSON有效负载:
{
"firstname":"darell",
"lastname":"abbott",
"address":"philippines"
}
邮差有效载荷
邮递员档案
有没有办法放置JSON有效负载,MultiPartFile
或文件在邮递员中一起上传,或者REST WebService中的POST方法不允许有效负载与MultiPartFile
一起使用。请任何帮助thnx。