I've been struggling to send a simple string using $http.post in angularjs to a service in java. In the string I'm sending xhtml template content to feed into a pdf service.
The service somehow sees the data sent as a JSON object instead of a string. e.g. if I want to send:
"<?xml version="1.0"><html><body><div>something</div></body></html>"
it converts the string sent to:
{"<?xml version": "\"1.0\"><html><body><div>something</div></body></html>"}
.
I have tried setting the content-type and also overriding the default.transformRequest but so far unsuccessful.