Hi,
I have a controller in Spring boot which looks this :
public ResponseEntity<
String> install(@RequestBody byte[] body,
@RequestParam(name = "param1", required = false) String param1,
@RequestParam(name = "param2", required = false) String param2)
where body is a file (xml, txt, zip ...).
This works fine when the Header content is "text/plain", I can get back the posted file and the params.
But my controller will be called with a header content = application/x-www-form-urlencoded, the caller is out of my scope, so I dont have choice, my code must be able to get back a file post with application/x-www-form-urlencoded.
Until now, I cannot make my code working with this header as soon as a file is posted. I don't understand how the file is posted with x-www-form-urlencoded and how I can get back the file with Spring.
I tried to not use @RequestBody any more and to use instead :
- @RequestParam MultiValueMap body
- @RequestParam Map<String, String> body
It does'nt work : it looks the original file is cut in many fragments.
Finally I wonder is there's a way in Spring to get back a file posted with application/x-www-form-urlencoded ?
Thanks for your help.
Anna.