Closed ggeorgovassilis closed 10 years ago
RequestPart may be better suited for this kind of behavior than RequestBody. A possibility of implementation keeping the RequestBody behavior but using the RequestPart parameters over the RequestBody: https://github.com/mguennec/spring-rest-invoker/commit/6fb4be9e006120a76e971f4259f67da6d4e2d3f1
@mguennec would you have a look at the current trunk and see if the implementation covers this ticket?
It looks good to me :+1:
@mguennec writes:
For example : @RequestMapping(value = "/folders/{folderId}/documents", method = RequestMethod.POST) Document createDocument(@PathVariable("folderId") String folderId, @RequestBody @RequestParam("properties") Document props, @RequestBody @RequestParam("data") Resource data);
It should send something like that : POST /folders/{folderId}/documents (multipart/form-data) { {(application/json) properties: {props content}}, {(application/octet-stream) data: {binarydatacontent}} }
The idea is to be able to send different types of contents (including binaries) in a form which is the behavior of FormHttpMessageConverter which can only work with a MultiValueMap and not a Map.