I have this spring boot controller method:
@PostMapping(path = "/myPath")
public String methodName(@RequestBody String incoming) { ...
However if I try to post an XML file to it with curl, like:
curl -X POST http://localhost:8080/myPath --data-binary @./my/path/my_file.xml
the incoming String is all escaped characters, like:
%3C%3Fxml+version=%221.0%22+encoding%3D%22UTF-8%...
and it blows up attempting to parse it with ...Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
when it should be like <?xml version="1.0"
what is going on?