I am trying to POST to http://localhost:9095/translators from an AngularJS front-end using Spring boot/Spring RestController backend.
I can do a GET and the response
You need @ResponseBody annotation like as follows:
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody public User addTranslator(@RequestBody User user) {
//translation.setTranslationId(null);
return repository.saveAndFlush(user);
}