I'm having some problems trying to get a response from the Spring RESTful web service to an AngularJS client.
I use ResponseEntity<String>to return the response to the client. This only works when the status code is returned, but using the "Angular error" parameter, Unexpected token Ran error occurs when sending a response message in the body.
What am I doing wrong?
return new ResponseEntity<String>(HttpStatus.OK);
But this does not work:
return new ResponseEntity<String>("Report was updated successfully", HttpStatus.OK);
AngularJs Code:
$http.get(url, header)
.success(function(data, status, headers, config) {
}).error(function(resp, status) {
});
Answer:

source
share